~vcs-imports/reviewboard/trunk

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
upstream reviewboard {
    server reviewboard:8080;
}

server {
    server_name ${NGINX_HOST};

    # If enabling SSL on Nginx, remove the "listen ${NGINX_PORT}" lines below
    # and use these settings instead. You will also need to change
    # X-Forwarded-Ssl below.
    #
    # listen [::]:443 ssl http2;
    # listen 443 ssl http2;
    # ssl_certificate /var/www/reviewboard/conf/ssl/fullchain.pem;
    # ssl_certificate_key /var/www/reviewboard/conf/ssl/privkey.pem;
    listen [::]:${NGINX_PORT};
    listen ${NGINX_PORT};

    root /var/www/reviewboard/htdocs;

    location / {
        proxy_pass http://reviewboard;
        proxy_redirect off;

        proxy_set_header Host $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-Port $server_port;
        proxy_set_header X-Forwarded-Proto $scheme;

        # NOTE: Set this to "on" if using SSL.
        proxy_set_header X-Forwarded-Ssl off;

        client_max_body_size        10m;
        client_body_buffer_size     128k;
        proxy_connect_timeout       90;
        proxy_send_timeout          90;
        proxy_read_timeout          90;
        proxy_headers_hash_max_size 512;
        proxy_buffer_size           4k;
        proxy_buffers               4 32k;
        proxy_busy_buffers_size     64k;
        proxy_temp_file_write_size  64k;
    }

    location /media/ {
        alias /var/www/reviewboard/htdocs/media/;
        expires max;
        add_header Cache-Control public;
    }

    location /static/ {
        alias /var/www/reviewboard/htdocs/static/;
        expires max;
        add_header Cache-Control public;
    }

    location /errordocs/ {
        alias /var/www/reviewboard/htdocs/errordocs/;
        expires 5d;
    }

    location /robots.txt {
        alias /var/www/reviewboard/htdocs/robots.txt;
        expires 5d;
    }
}