Skip to content

Instantly share code, notes, and snippets.

@douglascabral
Last active January 29, 2018 15:45
Show Gist options
  • Save douglascabral/2eb2cc43713effa582d688b34f270051 to your computer and use it in GitHub Desktop.
Save douglascabral/2eb2cc43713effa582d688b34f270051 to your computer and use it in GitHub Desktop.
Example of Apache Proxy
<VirtualHost *:80>
ServerName nome-do-servidor.com.br
ServerAdmin webmaster@localhost
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPass / http://127.0.0.1:8082/
ProxyPassReverse / http://127.0.0.1:8082/
ProxyRequests Off
#Proxy case insensitive
ProxyPassMatch "(?i)/something" "http://127.0.0.1:8082"
#(?i): case-insensitive match
#(.*): zero or more character
#$1: trailing text after match sting in the original string. for example (/site/index.html)
#Be careful with the trailing /
<Proxy http://localhost:8082/*>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>
@douglascabral
Copy link
Author

Apache modules:

sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_balancer
sudo a2enmod lbmethod_byrequests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment