server { listen 80; server_name localhost; client_max_body_size 128M; # serve media files location /static/ { alias /usr/share/webapps/recipes/staticfiles/; } location /media/ { alias /var/lib/recipes/media/; } location / { proxy_set_header Host $http_host; proxy_pass http://unix:/run/recipes/recipes.sock; proxy_set_header X-Forwarded-Proto $scheme; error_page 502 /errors/http502.html; } location /errors/ { alias /etc/nginx/http.d/errorpages/; internal; } }