Problem 2 – Proxy

  • Post author:
  • Post category:Blog

This was an easy one but worked on it for more than ten minutes so it deserves and entry:

Needed to setup a reverse proxy server for someone

vhost

ProxyRequests off

RewriteEngine On

RewriteRule /(.*) http://1.1.1.1/$1 [P,L,NC]

ProxyPassReverse http://1.1.1.1/

/vhost

P – Proxy, L – Last, NC – No Case

Anyway I could do the same thing with a ProxyPass but then redirects would break.

http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypassreverse

http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#access

Update: One really cool thing that I knew about for awhile but never got around to testing was storing all of the certificate information in one file (key, cert, and any root cert or chain). This works great and is super cool since you get things like:

SSLCertificateFile /etc/httpd/conf/certs/file
SSLCertificateKeyFile /etc/httpd/conf/certs/file
SSLCertificateChainFile /etc/httpd/conf/certs/file

Neat!