Reputation: 486
I have nginx as frontend for apache. Apache listen port 8008.
Nginx config
server {
listen 80;
server_name SERVER_NAME;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_pass http://localhost:8008;
}
}
When I open url SERVER_NAME, browser actualy opens url SERVER_NAME:8008. And apache respons to the browser, not nginx.
Upvotes: 0
Views: 75
Reputation: 382344
You should not have the forwarding if you want your proxy to act as front-end.
Thy just this:
server {
listen 80;
server_name SERVER_NAME;
location / {
proxy_pass http://localhost:8008;
}
}
Upvotes: 1