mediagoblin-setup/nginx.conf

66 lines
2.1 KiB
Nginx Configuration File
Raw Normal View History

2025-01-10 22:19:31 +00:00
server {
#################################################
# Stock useful config options, but ignore them :)
#################################################
include /etc/nginx/mime.types;
autoindex off;
default_type application/octet-stream;
sendfile on;
# Gzip
gzip on;
gzip_min_length 1024;
gzip_buffers 4 32k;
gzip_types text/plain application/x-javascript text/javascript text/xml text/css;
#####################################
# Mounting MediaGoblin stuff
# This is the section you should read
#####################################
# Change this to allow your users to upload larger files. If
# you enable audio or video you will need to increase this. This
# is essentially a security setting to prevent *extremely* large
# files being uploaded. Example settings include 500m and 1g.
client_max_body_size 100m;
# 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 media.cmxsl.org www.media.cmxsl.org;
access_log /var/log/nginx/media.cmxsl.access.log;
error_log /var/log/nginx/media.cmxsl.error.log;
# MediaGoblin's stock static files: CSS, JS, etc.
location /mgoblin_static/ {
alias /srv/media.cmxsl.org/mediagoblin/mediagoblin/static/;
}
# Instance specific media:
location /mgoblin_media/ {
alias /srv/media.cmxsl.org/mediagoblin/user_dev/media/public/;
}
# Theme static files (usually symlinked in)
location /theme_static/ {
alias /srv/media.cmxsl.org/mediagoblin/user_dev/theme_static/;
}
# Plugin static files (usually symlinked in)
location /plugin_static/ {
alias /srv/media.cmxsl.org/mediagoblin/user_dev/plugin_static/;
}
# Forward requests to the MediaGoblin app server.
location / {
proxy_pass http://127.0.0.1:6543;
# On Debian and derivatives the below proxy_set_header lines can be replaced by:
# include proxy_params;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}