aboutsummaryrefslogtreecommitdiffstats
path: root/roles/mediagoblin/templates/etc_nginx_sites-available_mediagoblin.j2
blob: 5a2c9ba17326c7b99629baceec8878881a3bb795 (plain)
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

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 "";
    }
}