I'm following the html5boilerplate nginx setup for the most part, but everything keeps breaking when I include expires.conf
.
HTML5BP for Nginx setup: https://github.com/h5bp/server-configs/tree/master/nginx
I've changed only a few very minor things which I'll put below. When in include conf/expires.conf
however everything returns 404.
As a sidenote, I don't think it's just HTML5BP either.. i also followed this guide and images also broke (under the heading for Nginx tip #5 static assets expire).
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 360d;
}
I'm using nginx on a server behind an EC2 elastic load balancer.
Here is my /etc/nginx/sites-enabled/example.conf:
server {
listen 80;
server_name localhost;
location / {
root /var/www/html/example.com;
index index.html index.htm;
}
# Specify a charset
charset utf-8;
# Custom 404 page
error_page 404 /404.html;
include conf/base.conf;
}
One odd thing i noticed is that if i check errors.log it has this..
2013/03/25 04:38:45 [error] 17920#0: *1 open() "/usr/share/nginx/html/index.html" failed (2: No such file or directory)
Yet I changed the directory away from /usr/share/nginx/html, so I have no idea why its looking there?