deploy/templates/nginx.static.conf.j2
author ymh <ymh.work@gmail.com>
Thu, 20 Sep 2018 18:45:04 +0200
changeset 15 799d0e9aa1dd
parent 10 28971cf04a91
permissions -rw-r--r--
Added tag 0.2.0 for changeset 521d1a8c7150

upstream {{annotations_api_upstream_name}} {
    server {{annotations_api_host}}:{{annotations_api_port}};
    server 127.0.0.1 backup;
}

upstream {{discussions_api_upstream_name}} {
    server {{discussions_host}}:{{discussions_port}};
    server 127.0.0.1 backup;
}


server {
    listen 80;
    listen [::]:80;

    server_name {{static_server_name}};

    access_log /var/log/nginx/{{static_server_name}}-access.log;
    error_log /var/log/nginx/{{static_server_name}}-error.log;

    root {{remote_static_path}}/;
    index index.html index.htm;


    location {{annotations_api_url}}/ {
        uwsgi_pass  {{annotations_api_upstream_name}};
        include /etc/nginx/uwsgi_params;
    }

    location {{discussions_url}}/ {
        uwsgi_pass  {{discussions_api_upstream_name}};
        include /etc/nginx/uwsgi_params;
    }

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ /index.html;
        # Uncomment to enable naxsi on this location
        # include /etc/nginx/naxsi.rules
    }
}