Install mod_proxy_http:
a2enmod proxy_http
Add to /etc/apache2/apache2.conf
(change ip):
<VirtualHost 11.1.11.111:80 >
ServerName site.com
ServerAlias *.site.com
CustomLog /var/www/httpd-logs/site.com.access.log combined
ErrorLog /var/www/httpd-logs/site.com.error.log
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ServerAdmin webmaster@site.com
SuexecUserGroup user user
</VirtualHost>
Add to /etc/apache2/mods-available/proxy.conf
:
<IfModule mod_proxy.c>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</IfModule>
Restart apache:
sudo service apache2 restart
In nginx site config specify port and upsteam:
upstream ContactAppProduction {
server unix:///tmp/MyAppProduction.sock;
}
server {
listen *:8080;
server_name site.com;
In /etc/nginx/conf.d/default.conf
change port from 80 to something else:
server {
listen 3000;
Restart nginx:
sudo service nginx restart
Than run app just with upstream. See.
Just a heads up - if you found this through google like me and got stuck on proxypassing when SSL is involved, you'll want to look at the SSLProxyEngine, SSLProxyCheckPeerCN, SSLProxyCheckPeerExpire directives for apache!