deploy/templates/nginx.static.conf.j2
changeset 2 f72ffe8b30b1
parent 0 5f4fcbc80b37
child 10 28971cf04a91
equal deleted inserted replaced
1:66f388fa2130 2:f72ffe8b30b1
       
     1 upstream annotation-api {
       
     2     server {{annotations_api_host}}:{{annotations_api_port}};
       
     3     server 127.0.0.1 backup;
       
     4 }
       
     5 
       
     6 upstream discussion-api {
       
     7     server {{discussions_host}}:{{discussions_port}};
       
     8     server 127.0.0.1 backup;
       
     9 }
       
    10 
       
    11 
       
    12 server {
       
    13     listen 80;
       
    14     listen [::]:80;
       
    15 
       
    16     server_name {{static_server_name}};
       
    17 
       
    18     access_log /var/log/nginx/{{static_server_name}}-access.log;
       
    19     error_log /var/log/nginx/{{static_server_name}}-error.log;
       
    20 
       
    21     root {{remote_static_path}}/;
       
    22     index index.html index.htm;
       
    23 
       
    24 
       
    25     location {{annotations_api_url}}/ {
       
    26         uwsgi_pass  annotation-api;
       
    27         include /etc/nginx/uwsgi_params;
       
    28     }
       
    29 
       
    30     location {{discussions_url}}/ {
       
    31         uwsgi_pass  discussion-api;
       
    32         include /etc/nginx/uwsgi_params;
       
    33     }
       
    34 
       
    35     location / {
       
    36         # First attempt to serve request as file, then
       
    37         # as directory, then fall back to displaying a 404.
       
    38         try_files $uri $uri/ /index.html;
       
    39         # Uncomment to enable naxsi on this location
       
    40         # include /etc/nginx/naxsi.rules
       
    41     }
       
    42 }