19
votes
Accepted
What is the use of ProxyPassReverse Directive
If the server actually handling a request does a redirect to a different URL on that server, the ProxyPassReverse directive rewrites the URL in terms of the reverse proxy server. For example, as noted ...
19
votes
Accepted
"No protocol handler valid for the URL" with httpd mod_proxy_balancer
facepalm
It turns out that I was missing a trailing slash on my ProxyPass directive:
ProxyPass "/site/" "balancer://cms"
should have been:
ProxyPass "/site/" "balancer://cms/"
(Note the trailing ...
13
votes
Accepted
Apache mod_proxy: forward secure websocket to non-secure
To get things to work, I also needed to load mod_proxy_wstunnel
Once I did, this ruleset got things working: (in the VirtualHost of the domain that receives and proxies the websocket request)
<...
12
votes
How can I enable logging for requests going through mod proxy
You can also append proxy:trace5 to your existing LogLevel directive
If you have this
LogLevel error
Change it to this
LogLevel error proxy:trace5
Be sure to change that back to normal after use....
11
votes
How to Exclude an URL for Apache Mod_proxy?
In addition to Alastair McCormack answer: If you use <Location>, you need to put the exception below instead of before:
<Location /my/>
ProxyPass balancer://backend-cluster1
</...
11
votes
Accepted
Apache proxy not working for a localhost port
Here is the solution for your problem:
To turn on this boolean you simple have to use this line
(root permissions)
setsebool -P httpd_can_network_connect on
or
sudo setsebool -P ...
8
votes
"No protocol handler valid for the URL" with httpd mod_proxy_balancer
In my case, I needed proxy_ajp module.
a2enmod proxy proxy_http proxy_ajp
7
votes
Accepted
Apache 2.4.7 mod_proxy_wstunnel tunneling too much (HTTP as well as WS)
anders' answer got me 95% of the way there.
The basic scenario:
We have a server on newapp.example.com
Port 8080 is running both HTTP and WebSockets
The URL that responds to WebSockets requests is /...
6
votes
What is the use of ProxyPassReverse Directive
From the Apache 2.4 Reverse proxy guide:
To ensure that and Location: headers generated from the backend are modified to point to the reverse proxy, instead of back to itself, the ProxyPassReverse ...
5
votes
Accepted
Apache mod_proxy with Tomcat 8.5 using http2
Apache httpd added HTTP/2 proxy support from 2.4.21 but suggest you run latest (2.4.27 at time of writing) as this module is still changing quite a bit at the moment.
Tomcat has just added HTTP/2 ...
5
votes
Apache: honouring the DNS ttl in proxy-pass
The only option that can be helpful for your use case is disablereuse=On.
The DNS queries are performed by resolver part of glibc. The results are not cached by this library, or by OS. In apache case ...
5
votes
No protocol handler was valid for the URL / (scheme 'ws')
I was getting that error as well. It happened when I proxying HTTPS requests to WS protocol. The error went away when I split the proxy to forward HTTPS requests to HTTP and WSS requests to WS.
To ...
4
votes
Apache Reverse Proxy Java Application Server CLOSE_WAIT Connections
This is a known issue with mod_proxy, since 2011.
The ttl needs to be shorter than the application's keepalive, so that apache is always first to send a FIN.
Another difficulty is it's not defined ...
4
votes
Apache ProxyPass: pass requested URL as GET parameter to destination URL
You should be using the ProxyPassMatch directive, if you want to use a regex, BUT as noted in the ProxyPass directive documentation
url is a partial URL for the remote server and cannot include a ...
4
votes
Accepted
Apache decoding semicolon - mod_proxy
mod_proxy canonicalise URLs passed to the backend. If you want suppress this behavior use nocanon keyword and this passes the URL path "raw" to the backend.
Eg:
ProxyPass / http://127.0.0.1:8081/ ...
4
votes
Accepted
Apache doesn't listen on all ports configured with virtual host and reverse proxy
Somewhere in your Apache configuration, you must have matching Listen directives for each port you want to listen to:
Listen 3000
Listen 3010
It appears that you already have one, but not the ...
4
votes
Apache2 mod_substitute not working in <Location>
I'm glad to say that there is a way to get around the interpolation issue, at least with the substitution issue.
Lots of google results for interpolation with mod_substitute come here, so I figured I'...
4
votes
Apache2 mod_substitute not working in <Location>
The only solution that was working for me, is:
AddOutputFilterByType INFLATE;SUBSTITUTE;DEFLATE text/html
Source:
https://phabricator.wikimedia.org/T282613
https://gitpull.it/T776
3
votes
"No protocol handler valid for the URL" with httpd mod_proxy_balancer
Same as kujiy i had to add the mod_ajp.
I am using apache4.
My log showed messages as follows:
No protocol handler was valid for the URL /jira.
If you are using a DSO version of mod_proxy,
make ...
3
votes
Accepted
Securing traffic handled with mod_proxy
I can't imagine the request would be exposed between Apache and Node, would it?
Well, yes it is but the surface is small and no worse really than apache passing it off to another daemon (e.g. php-fpm)...
3
votes
Using ProxyPassMatch for FastCGI, results in connection refused on port 9000
Per Chris's comment, I just wanted to add if apache/php does support socket connections (looks like if apache > 2.4.10, it can support it), you can also change to use that in your apache config.
I ...
3
votes
Add a header depending on the proxied response code with apache
I know that my answer is probably coming too late, but it can be useful to anyone wanting to set a Header in a HTTP Response based upon a condition, and more specifically upon a condition on the HTTP ...
3
votes
Understanding apache 2.4 mod_proxy_fcgi and RewriteRules in htaccess
With ProxyPassMatch, .htaccess files are ignored. Try using FilesMatch and SetHandler instead, as described here and here.
3
votes
ws protocol and apache mod_proxy_wstunnel configuration: error 500
Looks like you are missing mod_proxy_wstunnel module which is required for Websockets support.
It should be enabled like below in your httpd.conf
LoadModule proxy_wstunnel_module modules/...
3
votes
Apache mod_proxy: redirection based on http header?
Yes, it is possible.
Make a rewrite rule based on a conditional check of the REFERER header.
RewriteCond documentation
%{HTTP:header}, where header can be any HTTP MIME-header name, can always be ...
3
votes
Apache 2.4 sends 502 errors when backend sends 401 on large file uploads
The fix was to modify Tomcat config for 'maxSwallowSize' which has Tomcat swallow bytes before the response is sent.
https://tomcat.apache.org/tomcat-8.0-doc/config/http.html
maxSwallowSize
The ...
3
votes
Accepted
Apache RewriteRule on VirtualHosts doesn't work with group capture regex
The RewriteRule directive only matches on the path component, it does not include the query string. Try:
RewriteEngine On
RewriteCond %{QUERY_STRING} mode=crop.+width=(\d+)&height=(\d+)
...
3
votes
Accepted
Apache Reverse Proxy get 404 error
You need to put the ProxyPass /test above the ProxyPass /
The directives are evaluated in order with first-match, so in your configuration every request to /test is served by the proxy defined for /.
3
votes
Accepted
Apache header editing
You can use the RequestHeader directive to replace the header before it is sent to the backend server.
RequestHeader set Auhorization "Bearer some_text_goes_here"
If you want to actually remove part ...
3
votes
Accepted
Apache 2.4: mod_alias, mod_rewrite, mod_proxy execution order
The general rule is that the order of the directives is important. The directive that comes first and matches wins (just like the order of the VirtualHost definitions – the first VHost is the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mod-proxy × 690apache-2.2 × 406
apache-2.4 × 193
mod-rewrite × 142
reverse-proxy × 125
proxy × 60
tomcat × 55
proxypass × 47
virtualhost × 37
httpd × 36
apache2 × 31
ssl × 21
load-balancing × 21
mod-ssl × 19
linux × 18
ubuntu × 16
rewrite × 15
php-fpm × 13
mod-proxy-ajp × 13
nginx × 12
.htaccess × 11
https × 11
httpd.conf × 11
tomcat7 × 11
glassfish × 11