Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have set up Nginx as a reverse proxy to Apache on a web server.

Nginx is listening on and passing through to

This all seems to be working fine, except when I first load the site at the root level (i.e. nginx is not passing through to Apache, instead displaying the 'Welcome to Nginx!' page.

If I CTRL+F5 it will pass through to Apache, also passes through to Apache if I load any other pages on the site..

My vhost is set up as follows:

server {
    access_log /var/log/nginx/default.access.log;

    location / {
    include /etc/nginx/proxy_params;

My proxy_params is set up as follows:

proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

Any help on this one is greatly appreciated!

share|improve this question
Are you sure it isn't your browser's cache problem? – Tibor Jul 5 '12 at 22:10
Hi Tibor, I thought this at first, but definitely not browse cache – Gerard Jul 5 '12 at 22:36
FYI I just added a new vhost and it's working fine. The problematic site is a WordPress site (as is the new one that's working), though I can't see how this would be causing the issue as it's not running PHP just proxying to Apache?? – Gerard Jul 5 '12 at 22:45

Ok, managed to fix this by adding the following to proxy_params:

proxy_redirect off;

Not really sure why this would fix it, but it did!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.