summaryrefslogtreecommitdiffstats
path: root/roles/cgit/templates/cgit.nginx.conf.j2
blob: 4ac0ae433725a3b992b04e1653743bceb27e9a4e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
server {
    listen 80;
    listen [::]:80;
    server_name {{ cgit_hostname }};
    location / {
        proxy_pass http://{{ network_ipv4_address }}:{{ cgit_port }};
    }
}
{% if cgit_public_hostname is defined %}

server {
    listen 80;
    listen [::]:80;
    server_name {{ cgit_public_hostname }};
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name {{ cgit_public_hostname }};
    ssl_certificate {{ nginx_ssl_certificate }};
    ssl_certificate_key {{ nginx_ssl_certificate_key }};
    location / {
        proxy_pass http://{{ network_ipv4_address }}:{{ cgit_port }};
    }
}
{% endif %}