# {{ ansible_managed }} server { listen 80; listen [::]:80; server_name {{ mediagoblin_hostname }}; # Change this to update the upload size limit for your users client_max_body_size 1024m; # prevent attacks (someone uploading a .txt file that the browser # interprets as an HTML file, etc.) add_header X-Content-Type-Options nosniff; access_log /var/log/nginx/mediagoblin.access.log; error_log /var/log/nginx/mediagoblin.error.log; # MediaGoblin's stock static files: CSS, JS, etc. location /mgoblin_static/ { alias {{ mediagoblin_basedir }}/src/mediagoblin/static/; } # Instance specific media: location /mgoblin_media/ { alias {{ mediagoblin_basedir }}/data/media/public/; } # Theme static files (usually symlinked in) location /theme_static/ { alias {{ mediagoblin_basedir }}/src/user_dev/theme_static/; } # Plugin static files (usually symlinked in) location /plugin_static/ { alias {{ mediagoblin_basedir }}/src/user_dev/plugin_static/; } # # Mounting MediaGoblin itself via FastCGI. # location / { # fastcgi_pass 127.0.0.1:26543; # include /etc/nginx/fastcgi_params; # # # our understanding vs nginx's handling of script_name vs # # path_info don't match :) # fastcgi_param PATH_INFO $fastcgi_script_name; # fastcgi_param SCRIPT_NAME ""; # } # Until FastCGI works, just do a proxy pass location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://127.0.0.1:26543; } }