forked from infra/ansible
44 lines
930 B
Django/Jinja
44 lines
930 B
Django/Jinja
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
server_name {{ rocketchat_domain }};
|
|
|
|
location /.well-known/acme-challenge {
|
|
default_type "text/plain";
|
|
alias /var/www/acme-challenge;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://{{ rocketchat_domain }}$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
|
|
server_name {{ rocketchat_domain }};
|
|
|
|
ssl_certificate_key /etc/nginx/ssl/{{ rocketchat_domain }}.key;
|
|
ssl_certificate /etc/nginx/ssl/{{ rocketchat_domain }}.crt;
|
|
|
|
location / {
|
|
client_max_body_size 128M;
|
|
|
|
proxy_pass http://localhost:3000;
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $http_host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forward-Proto http;
|
|
proxy_set_header X-Nginx-Proxy true;
|
|
|
|
proxy_redirect off;
|
|
}
|
|
}
|