Newbie questions about nginx (moving from apache)

Thomas Love tomlove at gmail.com
Sat May 28 18:05:38 MSD 2011


On 28 May 2011 15:55, pk899 <nginx-forum at nginx.us> wrote:

> Thanks. But I am a bit confused, as the simple setup is not working from
> port 81 (for testing):
>
>
>  server {
>    listen 81;
>    server_name MYDOMAIN.com www.MYDOMAIN.com;
>
>    location ^~ /site/static {
>      root /home/MYDOMAIN/www/static;
>      index index.htm index.php;
>      expires       30d;
>      gzip          on;
>    }
>
>    location / {
>      proxy_pass      http://127.0.0.1:80/;
>      proxy_redirect  off;
>
>      proxy_set_header   Host             $host;
>      proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
>    }
>
>  }
>
> server {
   listen  81;
   server_name MYDOMAIN.com www.MYDOMAIN.com <http://www.mydomain.com/>;

   root  /home/MYDOMAIN/www;

   location / {
       proxy_pass        http://127.0.0.1:80;
       proxy_set_header  Host  $host;
       proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
   }

   location /static/ {
       index index.htm;
       expires      30d;
       gzip         on;
       gzip_static  on;
   }

}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20110528/bb330d26/attachment-0001.html>


More information about the nginx mailing list