miniflux/templates/nginx.conf.j2
author Luke Hoersten <luke@hoersten.org>
Mon, 07 Oct 2024 15:25:37 -0500
changeset 238 bdbc88cb5078
parent 202 252069788104
permissions -rw-r--r--
Lots of updates and fixes for Ubuntu 24.04 Noble.
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 / {
202
252069788104 Backed out changeset 10051617d075
Luke Hoersten <luke@hoersten.org>
parents: 200
diff changeset
    23
        proxy_pass {{nginx_proxy_pass}};
130
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    24
        proxy_redirect off;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    25
        proxy_set_header Host $host;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    26
        proxy_set_header X-Real-IP $remote_addr;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    27
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    28
        proxy_set_header X-Forwarded-Proto $scheme;
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    29
    }
46785fdb4fc5 Added miniflux role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    30
}