Skip to content

Instantly share code, notes, and snippets.

@alexklibisz
Created May 25, 2015 19:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save alexklibisz/995d5faf099f7ea10bd9 to your computer and use it in GitHub Desktop.
Save alexklibisz/995d5faf099f7ea10bd9 to your computer and use it in GitHub Desktop.
Apache Port Forward / Reverse Proxy Config
# Running some application on port 8080, want to make it
# available at subdomain.example.com
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName subdomain.example.com
ProxyPreserveHost On
# setup the proxy
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>
@alexklibisz
Copy link
Author

The file should get saved at /etc/apache2/mysite.conf

Before doing this, you should run:

a2enmod proxy proxy_ajp proxy_http rewrite deflate headers proxy_balancer proxy_connect proxy_html

After doing this, you should run:

$ a2ensite enable mysite

After that, restart the server.

@wiliscavalcante
Copy link

This worked for me, thanks @alexklibisz

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