upstream graphite { server 127.0.0.1:8080 fail_timeout=0; } server { listen 80 default_server; server_name HOSTNAME; root /opt/graphite/webapp; access_log /var/log/nginx/graphite.access.log; error_log /var/log/nginx/graphite.error.log; location = /favicon.ico { return 204; } # serve static content from the "content" directory location /static { alias /opt/graphite/webapp/content; expires max; } location / { try_files $uri @graphite; } location @graphite { proxy_pass_header Server; proxy_set_header Host $http_host; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Scheme $scheme; proxy_connect_timeout 10; proxy_read_timeout 10; proxy_pass http://graphite; } }