diff options
Diffstat (limited to 'roles/mediagoblin/templates/etc_nginx_sites-available_mediagoblin.j2')
-rw-r--r-- | roles/mediagoblin/templates/etc_nginx_sites-available_mediagoblin.j2 | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/roles/mediagoblin/templates/etc_nginx_sites-available_mediagoblin.j2 b/roles/mediagoblin/templates/etc_nginx_sites-available_mediagoblin.j2 new file mode 100644 index 0000000..5a2c9ba --- /dev/null +++ b/roles/mediagoblin/templates/etc_nginx_sites-available_mediagoblin.j2 @@ -0,0 +1,49 @@ + +server { + + listen 80; + listen [::]:80; + server_name {{ mediagoblin_hostname }}; + + # Change this to update the upload size limit for your users + client_max_body_size 8m; + + # prevent attacks (someone uploading a .txt file that the browser + # interprets as an HTML file, etc.) + add_header X-Content-Type-Options nosniff; + + server_name mediagoblin.example.org www.mediagoblin.example.org; + access_log /var/log/nginx/mediagoblin.example.access.log; + error_log /var/log/nginx/mediagoblin.example.error.log; + + # MediaGoblin's stock static files: CSS, JS, etc. + location /mgoblin_static/ { + alias /srv/mediagoblin.example.org/mediagoblin/mediagoblin/static/; + } + + # Instance specific media: + location /mgoblin_media/ { + alias /srv/mediagoblin.example.org/mediagoblin/user_dev/media/public/; + } + + # Theme static files (usually symlinked in) + location /theme_static/ { + alias /srv/mediagoblin.example.org/mediagoblin/user_dev/theme_static/; + } + + # Plugin static files (usually symlinked in) + location /plugin_static/ { + alias /srv/mediagoblin.example.org/mediagoblin/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 ""; + } +} |