miniflux/templates/nginx.conf.j2
author Luke Hoersten <luke@hoersten.org>
Sun, 06 Nov 2022 18:23:19 -0600
changeset 200 10051617d075
parent 130 46785fdb4fc5
child 202 252069788104
permissions -rw-r--r--
Fixed proxy pass.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
130
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
server {
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
    listen 80;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
    listen [::]:80;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
    server_name {{nginx_server_name}};
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
    return 301 https://$host$request_uri;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
}
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
server {
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
    listen 443 ssl http2;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
    # listen [::]:443 ssl ipv6only=on;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
    server_name {{nginx_server_name}};
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
    ssl_certificate {{nginx_ssl_cert}};
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
    ssl_certificate_key {{nginx_ssl_privkey}};
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
    include /etc/letsencrypt/options-ssl-nginx.conf;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
    ssl_ecdh_curve X25519:prime256v1:secp384r1:secp521r1;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
    ssl_stapling on;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    20
    ssl_stapling_verify on;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    21
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    22
    location / {
200
10051617d075 Fixed proxy pass.
Luke Hoersten <luke@hoersten.org>
parents: 130
diff changeset
    23
        set $upstream {{nginx_proxy_pass}};
10051617d075 Fixed proxy pass.
Luke Hoersten <luke@hoersten.org>
parents: 130
diff changeset
    24
        proxy_pass $upstream;
10051617d075 Fixed proxy pass.
Luke Hoersten <luke@hoersten.org>
parents: 130
diff changeset
    25
130
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    26
        proxy_redirect off;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    27
        proxy_set_header Host $host;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    28
        proxy_set_header X-Real-IP $remote_addr;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    29
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    30
        proxy_set_header X-Forwarded-Proto $scheme;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    31
    }
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    32
}