ansible-infra/playbooks/files/configs/esphome/nginx/esphome.conf

30 lines
973 B
Text
Raw Normal View History

2022-12-18 04:31:37 +01:00
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
2022-12-04 20:11:39 +01:00
server {
2022-12-18 04:31:37 +01:00
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name esphome.ccchh.net;
2022-12-18 04:31:37 +01:00
ssl_certificate /etc/ansible_certs/certs/esphome.ccchh.net/fullchain.pem;
ssl_certificate_key /etc/ansible_certs/certs/esphome.ccchh.net/privkey.pem;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /etc/ansible_certs/certs/esphome.ccchh.net/chain.pem;
add_header Strict-Transport-Security "max-age=63072000" always;
2022-12-04 20:11:39 +01:00
2022-12-18 04:31:37 +01:00
location / {
proxy_set_header Host $host;
proxy_redirect http:// https://;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://localhost:6052;
}
2022-12-04 20:11:39 +01:00
}