worker_processes 1; error_log ../logs/$logfile; pid ../pids/$pidfile; events { worker_connections 1024; } http { gzip on; gzip_disable "msie6"; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; error_log ../logs/$logfile; access_log ../logs/$logfile; include local/conf/mime.types; # relative to nginx.conf directory not base default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen $http_port; server_name localhost; # all static content location $base_url/static/ { $ifbase rewrite ^$base_url/static/(.*) /../../../static/$$1; $ifnobase rewrite ^/static/(.*) /$$1; root ../../static; index index.html; } # this is currently needed only for access to the index.html, which has to be at the top level: # (unfortunately, it provides access to all the static stuff one level up) location $base_url/ { $ifbase rewrite ^$base_url/(.*) /../../../static/$$1; root ../../static; index index.html; } } }