nginx.d.conf.j2 969 Bytes
Newer Older
1
2
3
4
#
# {{ ansible_managed }}
#

Sébastien Luttringer's avatar
Sébastien Luttringer committed
5
6
7
8
9
server {
    listen       80;
    listen       [::]:80;
    server_name  {{ archive_domain }};

10
    access_log   /var/log/nginx/{{ archive_domain }}/access.log main;
Sébastien Luttringer's avatar
Sébastien Luttringer committed
11
12
13
14
15
16
17
18
19
20
21
22
23
24
    error_log    /var/log/nginx/{{ archive_domain }}/error.log;

    include snippets/letsencrypt.conf;

    location / {
        rewrite ^(.*) https://$server_name$1 permanent;
    }
}

server {
    listen       443 ssl http2;
    listen       [::]:443 ssl http2;
    server_name  {{ archive_domain }};

25
    access_log   /var/log/nginx/{{ archive_domain }}/access.log main;
Sébastien Luttringer's avatar
Sébastien Luttringer committed
26
27
28
29
30
31
32
33
34
35
36
    error_log    /var/log/nginx/{{ archive_domain }}/error.log;

    ssl_certificate      /etc/letsencrypt/live/{{ archive_domain }}/fullchain.pem;
    ssl_certificate_key  /etc/letsencrypt/live/{{ archive_domain }}/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/{{ archive_domain }}/chain.pem;

    root         {{ archive_dir }};

    autoindex on;
    autoindex_exact_size off;
}