I've been scratching my head on this for far too long.
I have what I consider a simple configuration using the proxypass rules for Apache, I want to supply a list of exclusions before using a 'catchall' rule to redirect all traffic to a local node server.
The setup follows:
ProxyPass /contact-us !
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
The result of the above configuration is that /contact-us
is sent to node (localhost:3000
), as I understand the documentation it should be ignored. If I set a destination for /contact-us
then the request is correctly handled and the proxied content is returned.
Am I missing something? Does adding the catchall (/
) to the ruleset change the behaviour?
Edit: Added rest of file for reference
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName dev.site.com
ServerAdmin [email protected]
ProxyPass /contact-us !
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
DocumentRoot /var/www/site/public
<Directory /var/www/site/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
<IfModule mod_headers.c>
SetEnvIf Origin "^http(s)?://(.+\.)?(dev\.site\.com)$" origin_is=$0
Header always set Access-Control-Allow-Origin %{origin_is}e env=origin_is
Header always set Access-Control-Allow-Credentials true env=origin_is
</IfModule>
ErrorLog ${APACHE_LOG_DIR}/dev.site.com-error.log
CustomLog ${APACHE_LOG_DIR}/dev.site.com-access.log combined
SSLCertificateFile /etc/letsencrypt/live/dev.site.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/dev.site.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>
proxypass
rules for the virtualhost, as I understand it, any rules within a location directive are resolved before these are, so I made sure that wasn't the case. The rest of the configuration is quite vanilla, I'll add it to the OP.SetEnvIf Request_URI ^/contact-us$ no-proxy=1
.htaccess
file in either the DocumentRoot/var/www/site/public
or the/var/www/site/public/contact-us/
sub directory.htaccess
, I'll try cleaning those up just in case.