Files
hass.fnv/nginx/settings/site-confs/home-fnv.conf
T
2026-03-10 07:08:59 +00:00

65 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
upstream hass {
server 192.168.1.6:8123;
}
upstream certbot {
server 192.168.1.6:8081;
}
upstream z2m {
server 192.168.1.6:8080;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen 443 ssl;
server_name home-fnv.yandex5.ru;
ssl_certificate /config/keys/live/home-fnv.yandex5.ru/fullchain.pem;
ssl_certificate_key /config/keys/live/home-fnv.yandex5.ru/privkey.pem;
#access_log off;
location ~/.well-known/acme-challenge/(.*)$ {
proxy_pass http://certbot;
}
#access_log off;
location /z2m {
auth_basic "Administrator’s Area";
auth_basic_user_file conf.d/z2m_htpasswd;
proxy_pass http://192.168.1.6:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /z2m/api {
auth_basic "Administrator’s Area";
auth_basic_user_file conf.d/z2m_htpasswd;
proxy_pass http://192.168.1.6:8080/api;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
real_ip_header X-Forwarded-For;
set_real_ip_from 0.0.0.0/0;
proxy_pass http://hass;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}