This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
default.conf.tmpl
69 lines (54 loc) · 1.76 KB
/
default.conf.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
server {
listen ${PORT};
#################################################
# 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 update the upload size limit for your users
client_max_body_size 800m;
# 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 $DOMAIN www.${DOMAIN};
access_log /var/log/nginx/${DOMAIN}.access.log;
error_log /var/log/nginx/${DOMAIN}.error.log;
# MediaGoblin's stock static files: CSS, JS, etc.
location /mgoblin_static/ {
alias ${APP_ROOT}/mediagoblin/static/;
}
# Instance specific media:
location /mgoblin_media/ {
alias ${APP_ROOT}/user_dev/media/public/;
}
# Theme static files (usually symlinked in)
location /theme_static/ {
alias ${APP_ROOT}/user_dev/theme_static/;
}
# Plugin static files (usually symlinked in)
location /plugin_static/ {
alias ${APP_ROOT}/user_dev/plugin_static/;
}
# This is a view-only config, so block authentication.
location /auth {
deny all;
}
location / {
proxy_pass http://127.0.0.1:6543;
auth_basic "Caution: High Voltage";
auth_basic_user_file /etc/nginx/.htpasswd;
sub_filter "/mgoblin_media/media_entries/" "https://storage.googleapis.com/${GCS_BUCKET}/media_entries/";
sub_filter_once off;
}
}