serve static content on static domain

zuckbin nginx-forum at nginx.us
Wed Apr 11 07:06:21 UTC 2012


ok, can i do this ?


server {
        listen ip:80;
        server_name     yourserver.com;
        root /srv/http/nginx/yourserver.com;
        access_log      logs/yourserver.com.access.log;
        location / {
        index index.html;
        charset   utf-8;
        }
     
        }

        }

        server {
        listen  ip:80;
        server_name     static.static-yourserver.com;
        root /srv/http/nginx/yourserver.com;
        location / {
                if ($request_filename ~
"\.(jpg|css|gif|png|swf|ico|mp3)$") {
                        break;
                }
        return 404;
        }
        }

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,225020,225165#msg-225165



More information about the nginx mailing list