diff options
| author | 2026-10-22 20:20:17 +0000 | |
|---|---|---|
| committer | 2026-10-22 20:20:17 +0000 | |
| commit | 62428777b7862720c1441e126a26f53c6076ba94 (patch) | |
| tree | c39ae0c841e5f20f5155cbc8776a6d61e634d3cb /roles/cosmos/templates | |
| parent | feat: add personal site (diff) | |
| download | infra-62428777b7862720c1441e126a26f53c6076ba94.tar.gz | |
feat: add cosmos site
Diffstat (limited to 'roles/cosmos/templates')
| -rw-r--r-- | roles/cosmos/templates/nginx.conf.j2 | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/roles/cosmos/templates/nginx.conf.j2 b/roles/cosmos/templates/nginx.conf.j2 new file mode 100644 index 0000000..b9b6c67 --- /dev/null +++ b/roles/cosmos/templates/nginx.conf.j2 | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | # -*- Nginx -*- | ||
| 2 | # {{ ansible_managed }} | ||
| 3 | |||
| 4 | server { | ||
| 5 | listen 80; | ||
| 6 | listen [::]:80; | ||
| 7 | server_name cosmos.party | ||
| 8 | www.cosmos.party | ||
| 9 | git.cosmos.party | ||
| 10 | lists.cosmos.party | ||
| 11 | andr.cosmos.party; | ||
| 12 | |||
| 13 | location ^~ /.well-known/acme-challenge/ { | ||
| 14 | root /var/www/acme; | ||
| 15 | } | ||
| 16 | |||
| 17 | location / { | ||
| 18 | return 307 https://$host$request_uri; | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | server { | ||
| 23 | server_name cosmos.party | ||
| 24 | www.cosmos.party; | ||
| 25 | |||
| 26 | listen unix:/var/run/nginx/http.sock; | ||
| 27 | listen 443 ssl; | ||
| 28 | listen [::]:443 ssl; | ||
| 29 | listen 443 quic; | ||
| 30 | listen [::]:443 quic; | ||
| 31 | |||
| 32 | http2 on; | ||
| 33 | http3 on; | ||
| 34 | |||
| 35 | add_header Alt-Svc 'h3=":443"; ma=86400'; | ||
| 36 | |||
| 37 | ssl_certificate /etc/ssl/cosmos.party.fullchain.pem; | ||
| 38 | ssl_certificate_key /etc/ssl/private/cosmos.party.key; | ||
| 39 | ssl_protocols TLSv1.2 TLSv1.3; | ||
| 40 | |||
| 41 | root /srv/http/cosmos.party; | ||
| 42 | index index.html; | ||
| 43 | |||
| 44 | location /en/ { try_files $uri $uri/ =404; } | ||
| 45 | location /ru/ { try_files $uri $uri/ =404; } | ||
| 46 | location /sk/ { try_files $uri $uri/ =404; } | ||
| 47 | location / { try_files $uri /en$uri /en$uri/ =404; } | ||
| 48 | } | ||
| 49 | |||
| 50 | server { | ||
| 51 | server_name andr.cosmos.party; | ||
| 52 | |||
| 53 | |||
| 54 | listen unix:/var/run/nginx/http.sock; | ||
| 55 | listen 443 ssl; | ||
| 56 | listen [::]:443 ssl; | ||
| 57 | listen 443 quic; | ||
| 58 | listen [::]:443 quic; | ||
| 59 | |||
| 60 | http2 on; | ||
| 61 | http3 on; | ||
| 62 | |||
| 63 | ssl_certificate /etc/ssl/cosmos.party.fullchain.pem; | ||
| 64 | ssl_certificate_key /etc/ssl/private/cosmos.party.key; | ||
| 65 | ssl_protocols TLSv1.2 TLSv1.3; | ||
| 66 | |||
| 67 | add_header Alt-Svc 'h3=":443"; ma=86400'; | ||
| 68 | |||
| 69 | root /srv/http/$host; | ||
| 70 | autoindex on; | ||
| 71 | } | ||
