aboutsummaryrefslogtreecommitdiffstats
path: root/config/nginx.conf.example
blob: 7b8af2bd99a51e96e25f7010b837e606a72bcc75 (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
upstream alaveteli {
    server 127.0.0.1:3000;
}

# Example to redirect other domains to the canonical URL. Also redirects the
# unqualified domain to the FQDN www.example.com, which is recommended.
#
# server {
#   server_name example.com example.org www.example.org;
#   rewrite ^(.*) http://www.example.com$1 permanent;
# }

server {
    listen 80;
    # Set the server name to your domain name if you have multiple nginx servers
    # running on your machine
    # server_name www.example.com;
    root /var/www/alaveteli/alaveteli/public;

    server_tokens off;

    access_log /var/log/nginx/alaveteli_access.log;
    error_log /var/log/nginx/alaveteli_error.log error;

    try_files $uri/index.html $uri @alaveteli;


    location /download {
        internal;
        alias /var/www/alaveteli/alaveteli/cache/zips/production/download;
    }

    location @alaveteli {
        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 http;
        proxy_set_header X-Sendfile-Type X-Accel-Redirect;
        proxy_set_header X-Accel-Mapping /var/www/alaveteli/alaveteli/cache/zips/production/download=/download;
        proxy_redirect off;
        proxy_pass http://alaveteli;
    }
}