proxy pass domain FROM default apache port 80 TO nginx on another port

Posted by user10580 on Server Fault See other posts from Server Fault or by user10580
Published on 2012-12-05T10:19:11Z Indexed on 2012/12/05 11:08 UTC
Read the original article Hit count: 181

Filed under:
|

Im still learning server things so hope the title is descriptive enough.

Basically i have sub.domain.com that i want to run on nginx at port 8090.

I want to leave apache alone and have it catch all default traffic at port 80.

so i am trying something with a virtual name host to proxy pass to sub.domain.com:8090, nothing working yet and go no idea what the right syntax could be.

any ideas? most of what i found was to pass TO apache FROM nginx, but i want to the do the opposite.

LoadModule proxy_module modules/mod_proxy.so

LoadModule proxy_http_module modules/mod_proxy_http.so

<VirtualHost sub.domain.com:80>

ProxyPreserveHost On

ProxyRequests Off

ServerName sub.domain.com

DocumentRoot /home/app/public

ServerAlias sub.domain.com

proxyPass / http://appname:8090/ (also tried localhost and sub.domain.com)

ProxyPassReverse / http://appname:8090/

</VirtualHost>

when i do this i get

[warn] module proxy_module is already loaded, skippin

[warn] module proxy_http_module is already loaded, skipping

[error] (EAI 2)Name or service not known: Could not resolve host name sub.domain.com -- ignoring!

and yes, the app is working (i have it running on port 80 with another subdomain) and it works at sub.domain.com:8090

© Server Fault or respective owner

Related posts about apache2

Related posts about mod-proxy