eletrotupi / tcc/ ansible/roles/nginx/templates/site.https.j21f2f0a154b75b7aab487b802e714150fc0eab4f5
1.1 KB | 46 lines Raw
1
server {
2
    listen 80;
3
    server_name {{ vhosts[0] }};
4

5
    location ^~ /.well-known {
6
        root /var/www;
7
    }
8

9
    location / {
10
        return 302 https://$host$request_uri;
11
    }
12
}
13

14
server {
15
    listen 443 ssl;
16
    listen [::]:443 ssl;
17

18
    server_name {{ vhosts[0] }};
19

20
    ssl_certificate {{ nginx_cert_dir }}/{{ vhosts[0] }}/cert.pem;
21
    ssl_certificate_key {{ nginx_cert_dir }}/private/{{ vhosts[0] }}/key.pem;
22

23
    ssl_protocols TLSv1.2 TLSv1.3;
24

25
    add_header X-Clacks-Overhead "GNU Terry Pratchett";
26
    add_header Permissions-Policy interest-cohort=();
27

28
    location = /monografia {
29
        alias {{ nginx_static_root }}/monografia.pdf;
30
        add_header Content-Type application/pdf;
31
        add_header Content-Disposition "inline";
32
    }
33

34
    location / {
35
        proxy_pass {{ nginx_proxy_pass }};
36
        proxy_set_header Host $host;
37
        proxy_set_header X-Real-IP $remote_addr;
38
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
39
        proxy_set_header X-Forwarded-Proto $scheme;
40
        proxy_set_header X-Forwarded-Host $host;
41
    }
42

43
    location ^~ /.well-known {
44
        root /var/www;
45
    }
46
}