aimee-os/yellow/overlay/etc/nginx/conf.d/default.conf

71 lines
1.7 KiB
Plaintext

# vim: set sw=4 ts=4 sts=4 et :
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
return 301 https://$host$request_uri;
error_page 500 502 503 504 /50x.html;
location = /50x.html { }
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name _;
root /usr/share/nginx/html;
ssl_certificate "/etc/nginx/ssl/server.crt";
ssl_certificate_key "/etc/nginx/ssl/server.key";
ssl_session_cache shared:SSL:1m;
ssl_prefer_server_ciphers on;
error_page 500 502 503 504 /50x.html;
add_header
Strict-Transport-Security
"max-age=63072000; includeSubDomains"
always;
location = /50x.html { }
location = /zwave {
return 301 https://$host/zwave/;
}
location = /zigbee {
return 301 https://$host/zigbee/;
}
location /zwave/ {
proxy_pass http://127.0.0.1:8091/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-External-Path /zwave;
}
location /zigbee/ {
proxy_pass http://127.0.0.1:8080/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-External-Path /zigbee;
}
location / {
proxy_pass http://[::1]:8123/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}