Forum: NGINX How to... - nginx config to serve static files

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Nginx Forum (Guest)
on 2009-03-14 07:29
(Received via mailing list)
From "nginx config to serve static files" at
http://forum.nginx.org/showthread.php?t=11

***************
Dear all,

I currently have setupped my nginx to be able to serve static files. The
snippets is as such:

Code:
---------
server {
        listen   80;
        server_name  72.14.185.215;

        location / {
                root   /var/www/nginx-default;
                index  index.html index.htm;
        }

        location /media {
                root /var/www/media;
#               autoindex on;
#               allow all;
        }
}
---------
Now when I access from the browser using this address
http://72.14.185.215/media , I get a 404 message. I already created the
/var/www/media folder. Have I missed on something here?

Thanks in advance
***************

Posted by jpartogi
This topic is locked and can not be replied to.