Try_files and static web site

I have a site that is completely static and I figured I would use
try_files however this results in HTTP 500 errors for directories i.e.
trying to get to results in a 500 error. What’s
wrong with this config? Thanks.


server {
# port to listen on. Can also be set to an IP:PORT
listen 80;

# Set the charset
charset utf-8;

# sets the domain[s] that this vhost server requests for

# doc root
root /var/www/;

# vhost specific access log
access_log  /var/log/nginx_access.log  main;

# Catchall for everything else
location / {
  root /var/www/;
  access_log off;

  index index.html index.shtml;
  expires 1d;

  try_files $uri $uri/;

  #if (-f $request_filename) {
  #  break;

error_page 500 502 503 504 /500.html;
error_page 404 /404.html;


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs