1 | server {
|
---|
2 | #################################################
|
---|
3 | # Stock useful config options, but ignore them :)
|
---|
4 | #################################################
|
---|
5 | include /etc/nginx/mime.types;
|
---|
6 |
|
---|
7 | autoindex off;
|
---|
8 | default_type application/octet-stream;
|
---|
9 | sendfile on;
|
---|
10 |
|
---|
11 | # Gzip
|
---|
12 | gzip on;
|
---|
13 | gzip_min_length 1024;
|
---|
14 | gzip_buffers 4 32k;
|
---|
15 | gzip_types text/plain text/html application/x-javascript text/javascript text/xml text/css;
|
---|
16 |
|
---|
17 | #####################################
|
---|
18 | # Mounting MediaGoblin stuff
|
---|
19 | # This is the section you should read
|
---|
20 | #####################################
|
---|
21 |
|
---|
22 | # Change this to update the upload size limit for your users
|
---|
23 | client_max_body_size 8m;
|
---|
24 |
|
---|
25 | # prevent attacks (someone uploading a .txt file that the browser
|
---|
26 | # interprets as an HTML file, etc.)
|
---|
27 | add_header X-Content-Type-Options nosniff;
|
---|
28 |
|
---|
29 | server_name {{ pillar['mediagoblin']['domain'] }} www.{{ pillar['mediagoblin']['domain'] }};
|
---|
30 | access_log /var/log/nginx/{{ pillar['mediagoblin']['domain'] }}.access.log;
|
---|
31 | error_log /var/log/nginx/{{ pillar['mediagoblin']['domain'] }}.error.log;
|
---|
32 |
|
---|
33 | # MediaGoblin's stock static files: CSS, JS, etc.
|
---|
34 | location /mgoblin_static/ {
|
---|
35 | alias /srv/{{ pillar['mediagoblin']['domain'] }}/mediagoblin/mediagoblin/static/;
|
---|
36 | }
|
---|
37 |
|
---|
38 | # Instance specific media:
|
---|
39 | location /mgoblin_media/ {
|
---|
40 | alias /srv/{{ pillar['mediagoblin']['domain'] }}/mediagoblin/user_dev/media/public/;
|
---|
41 | }
|
---|
42 |
|
---|
43 | # Theme static files (usually symlinked in)
|
---|
44 | location /theme_static/ {
|
---|
45 | alias /srv/{{ pillar['mediagoblin']['domain'] }}/mediagoblin/user_dev/theme_static/;
|
---|
46 | }
|
---|
47 |
|
---|
48 | # Plugin static files (usually symlinked in)
|
---|
49 | location /plugin_static/ {
|
---|
50 | alias /srv/{{ pillar['mediagoblin']['domain'] }}/mediagoblin/user_dev/plugin_static/;
|
---|
51 | }
|
---|
52 |
|
---|
53 | # Mounting MediaGoblin itself via FastCGI.
|
---|
54 | location / {
|
---|
55 | fastcgi_pass 127.0.0.1:26543;
|
---|
56 | include /etc/nginx/fastcgi_params;
|
---|
57 |
|
---|
58 | # our understanding vs nginx's handling of script_name vs
|
---|
59 | # path_info don't match :)
|
---|
60 | fastcgi_param PATH_INFO $fastcgi_script_name;
|
---|
61 | fastcgi_param SCRIPT_NAME "";
|
---|
62 | }
|
---|
63 | }
|
---|
64 |
|
---|