Skip to main content
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 ...
Colt's user avatar
  • 2,067
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 ...
Christopher Schultz's user avatar
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) <...
BeetleJuice's user avatar
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....
yunzen's user avatar
  • 375
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 </...
frame's user avatar
  • 111
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 ...
Mchoeti's user avatar
  • 226
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
kujiy's user avatar
  • 486
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 /...
Brian Beckett's user avatar
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 ...
karatedog's user avatar
  • 285
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 ...
Barry Pollard's user avatar
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 ...
Mircea Vutcovici's user avatar
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 ...
Stephen Ostermiller's user avatar
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 ...
OrangeDog's user avatar
  • 588
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 ...
Colt's user avatar
  • 2,067
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/ ...
Federico Sierra's user avatar
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 ...
Michael Hampton's user avatar
4 votes

how to fix apache2 "proxy_http:error" AH01102: error reading status line from remote server localhost:4382

If you look at your log, first appear (70007)The timeout specified has expired: [client 178.153.198.97:52385] AH01095 the rest of the log is a kind of consequence of that. What is happening here is ...
Maria Mercedes Wyss Alvarez's user avatar
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'...
OioiGuvnor's user avatar
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
Valerio Bozz's user avatar
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 ...
Yogesh Devi's user avatar
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)...
user9517's user avatar
  • 116k
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 ...
armyofda12mnkeys's user avatar
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 ...
Denis's user avatar
  • 39
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.
Peter Nowee's user avatar
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/...
serverliving.com's user avatar
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 ...
Dti's user avatar
  • 66
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 ...
bunkowm's user avatar
  • 33
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+) ...
Jeff Snider's user avatar
  • 3,282
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 /.
Andreas Rogge's user avatar
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 ...
Gerald Schneider's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible