1
0
forked from infra/ansible
infra/roles/hackmd/templates/vhost.j2

53 lines
1.2 KiB
Plaintext
Raw Normal View History

2020-12-28 17:53:02 +01:00
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
2018-04-09 21:28:36 +02:00
server {
listen 80;
listen [::]:80;
server_name {{ hedgedoc_domain }};
2018-04-09 21:28:36 +02:00
location /.well-known/acme-challenge {
default_type "text/plain";
alias /var/www/acme-challenge;
}
location / {
return 301 https://{{ hedgedoc_domain }}$request_uri;
2018-04-09 21:28:36 +02:00
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {{ hedgedoc_domain }};
2018-04-09 21:28:36 +02:00
ssl_certificate_key /etc/nginx/ssl/{{ hedgedoc_domain }}.key;
ssl_certificate /etc/nginx/ssl/{{ hedgedoc_domain }}.crt;
2018-04-09 21:28:36 +02:00
2019-03-07 21:17:19 +01:00
# set max upload size
client_max_body_size 8M;
2018-04-09 21:28:36 +02:00
location / {
2020-12-28 17:53:02 +01:00
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
2018-04-09 21:28:36 +02:00
proxy_set_header X-Real-IP $remote_addr;
2018-04-12 18:30:30 +02:00
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2020-12-28 17:53:02 +01:00
proxy_set_header X-Forwarded-Proto $scheme;
2018-04-09 21:28:36 +02:00
}
2020-12-28 17:53:02 +01:00
location /socket.io/ {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
2018-04-09 21:28:36 +02:00
}