nginx config to serve static files
I currently have setupped my nginx to be able to serve static files. The snippets is as such:
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
Thanks in advance
2 Replies
chances are the "/" location is used first, it evaluates to
"/var/www/nginx-default" + "media" –> "/var/www/nginx-default/media" (which doesn't exist i assume)
and returns the 404
Just pointing that out. :\