Files
addons/nginx_proxy/nginx.conf
Ville Skyttä 25f9097e22 nginx_proxy: Update run.sh info messages, make HSTS configurable and optional (#264)
* nginx_proxy: Update run.sh info messages

In particular, note that generating dhparams will take some time.

* nginx_proxy: Bump version to 1.1

* nginx_proxy: Make HSTS configurable and optional

Unconditional HSTS breaks unencrypted connections to non-standard HTTP
ports on the same hostname. These ports be e.g. mapped outside of
hassio/nginx, and this can not be always circumvented by proxying them
beind nginx, because not all services behave properly behind a reverse
proxy.

Additionally, the unconditional HSTS includeSubDomains setting
hardcodes assumptions about subdomains that hassio does not
necessarily deal with at all.

* fix style
2018-03-25 23:57:01 +02:00

66 lines
1.6 KiB
Nginx Configuration File

daemon off;
error_log stderr;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
server_name _;
listen [::]:80 default_server ipv6only=off;
listen [::]:443 ssl http2 default_server ipv6only=off;
ssl_certificate /data/ssl-cert-snakeoil.pem;
ssl_certificate_key /data/ssl-cert-snakeoil.key;
return 444;
}
server {
server_name %%DOMAIN%%;
# These shouldn't need to be changed
listen [::]:80;
return 301 https://$host$request_uri;
}
server {
server_name %%DOMAIN%%;
ssl_certificate /ssl/%%FULLCHAIN%%;
ssl_certificate_key /ssl/%%PRIVKEY%%;
# dhparams file
ssl_dhparam /data/dhparams.pem;
listen [::]:443 http2;
%%HSTS%%
ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
proxy_buffering off;
#include /share/nginx_proxy_default*.conf;
location / {
proxy_pass http://homeassistant: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;
}
}
#include /share/nginx_proxy/*.conf;
}