Newbie questions about nginx (moving from apache)

pk899 nginx-forum at
Sat May 28 17:55:10 MSD 2011

Thanks. But I am a bit confused, as the simple setup is not working from
port 81 (for testing): 

  server {
    listen 81;

    location ^~ /site/static {
      root /home/MYDOMAIN/www/static;
      index index.htm index.php;
      expires       30d;
      gzip          on;
    location / {
      proxy_redirect  off;
      proxy_set_header   Host             $host;
      proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;


Then I try in my browser this:    

On the server the "test.gif" file is at


(1) What am I missing? Should the test.gif file be somewhere else?
Should I try this with some other URL instead of the one I mention

(2) Also, if this worked, and I accepted Nginx to be at the front and
moved Apache to the background, isn't it true that Apache would have to
pass back all processed output to Nginx? 

(3) Even with "proxy_redirect off", when I try,
it actually does a hard 301 redirect to my Apache server. 

What am I missing?

Posted at Nginx Forum:,201449,201787#msg-201787

More information about the nginx mailing list