Serving website with Apache, with Nginx as interface?

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

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

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

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:,266874,266895#msg-266895

More information about the nginx mailing list