Monday, June 3, 2019

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

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






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/







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

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...