]> Untitled Git - lemmy.git/blob - ansible/templates/nginx.conf
added env file
[lemmy.git] / ansible / templates / nginx.conf
1 server {
2     listen 80;
3     server_name {{ domain }};
4     location /.well-known/acme-challenge/ {
5         root /var/www/certbot;
6     }
7     location / {
8         return 301 https://$host$request_uri;
9     }
10 }
11
12 server {
13     listen 443 ssl http2;
14     server_name {{ domain }};
15
16     ssl_certificate /certs/live/{{ domain }}/fullchain.pem;
17     ssl_certificate_key /certs/live/{{ domain }}/privkey.pem;
18
19     # TODO: add security params
20
21     location / {
22         rewrite (\/(user|u|inbox|post|community|c|login|search|sponsors|communities|modlog|home)+) /static/index.html break;
23         proxy_pass http://0.0.0.0:8536;
24         proxy_set_header X-Real-IP $remote_addr;
25         proxy_set_header Host $host;
26         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
27
28         # WebSocket support
29         proxy_http_version 1.1;
30         proxy_set_header Upgrade $http_upgrade;
31         proxy_set_header Connection "upgrade";
32     }
33 }