First commit

This commit is contained in:
2023-04-22 01:48:50 +05:00
commit b3fe570a48
27 changed files with 803 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ha1.eax.app;
root /srv/homeassistant/lib/python3.10/site-packages/hass_frontend/;
# SSL
ssl_certificate /etc/letsencrypt/live/eax.app/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/eax.app/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/eax.app/chain.pem;
# security
include nginxconfig.io/security.conf;
# restrict methods
if ($request_method !~ ^(GET|POST|HEAD|CONNECT|OPTIONS|TRACE|DELETE)$) {
return '405';
}
# logging
access_log /var/log/nginx/ha1.eax.app.access.log;
error_log /var/log/nginx/ha1.eax.app.error.log warn;
# index.html fallback
location / {
proxy_pass http://127.0.0.1:8123/;
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 Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location /api/websocket {
proxy_pass http://127.0.0.1:8123/api/websocket;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
# additional config
include nginxconfig.io/general.conf;
}
# HTTP redirect
server {
listen 80;
listen [::]:80;
server_name ha1.eax.app;
include nginxconfig.io/letsencrypt.conf;
location / {
return 301 https://ha1.eax.app$request_uri;
}
}