mercurial/web/templates/hgweb.nginx.conf.j2
author Luke Hoersten <luke@hoersten.org>
Sat, 03 Jul 2021 11:09:26 -0500
changeset 153 dbc589234a49
parent 56 59e94b4a91a2
child 195 da34c8d7511d
permissions -rw-r--r--
Added difficulty config.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
server {
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
    listen 80;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
    listen [::]:80;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
    server_name {{nginx_server_name}};
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
    return 301 https://$host$request_uri;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
}
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
server {
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
    listen 443 ssl http2;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
#    listen [::]:443 ssl ipv6only=on;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
    server_name {{nginx_server_name}};
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
    ssl_certificate {{nginx_ssl_cert}};
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
    ssl_certificate_key {{nginx_ssl_privkey}};
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
    include /etc/letsencrypt/options-ssl-nginx.conf;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
    ssl_ecdh_curve X25519:prime256v1:secp384r1:secp521r1;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
    ssl_stapling on;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    20
    ssl_stapling_verify on;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    21
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    22
    location / {
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    23
        include     uwsgi_params;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    24
        uwsgi_param REMOTE_PORT     $remote_port;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    25
        uwsgi_param SERVER_PORT     $server_port;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    26
        uwsgi_param SERVER_PROTOCOL $server_protocol;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    27
        uwsgi_param UWSGI_SCHEME    $scheme;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    28
        uwsgi_param SCRIPT_NAME     /;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    29
        uwsgi_param AUTH_USER       $remote_user;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    30
        uwsgi_param REMOTE_USER     $remote_user;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    31
        uwsgi_pass  unix:/run/uwsgi/app/hgweb/socket;
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    32
    }
59e94b4a91a2 Added mercurial web hosting
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    33
}