Serving website with Apache, with Nginx as interface?

itpp2012 nginx-forum at forum.nginx.org
Sat May 14 09:55:02 UTC 2016


Alex Hall Wrote:
-------------------------------------------------------
> upstream apache2Redirect {
>   server 127.0.0.1:8080;
> }
> 
> location / {
>   proxy_set_header Host $host;
>   proxy_pass http://apache2Redirect;
> }

Browser(get localhost:8080) -> osticket (return responses with
localhost:8080)

Browser(get localhost:80) -> nginx proxy_pass localhost:8080 -> osticket
(return responses with localhost:8080)
Browser attempts 8080 which is not the nginx proxy.

Ea. sometimes you need to tell the backend (osticket) what it's frontend
address/port is.

This is a typical issue with tomcat applications, where you have to tell it
is running on port 443 eventhough it is listening on port 8443 because nginx
is setting in between handling port 443 proxying to 8443.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,266874,266895#msg-266895



More information about the nginx mailing list