mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 18:01:03 +01:00
Improve ssl.conf
https://github.com/alexbelgium/hassio-addons/issues/1703
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
server {
|
||||
|
||||
server {
|
||||
listen 9001;
|
||||
|
||||
include /etc/nginx/includes/server_params.conf;
|
||||
@@ -8,6 +7,10 @@
|
||||
ssl_certificate /ssl/%%certfile%%;
|
||||
ssl_certificate_key /ssl/%%keyfile%%;
|
||||
|
||||
proxy_buffering off;
|
||||
gzip_static off;
|
||||
client_max_body_size 0;
|
||||
|
||||
location / {
|
||||
# Proxy pass
|
||||
proxy_pass http://localhost:9000;
|
||||
@@ -18,17 +21,25 @@
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
# Improve ip handling
|
||||
proxy_hide_header X-Powered-By;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Accept-Encoding "";
|
||||
proxy_read_timeout 90;
|
||||
|
||||
# Correct base_url
|
||||
# Ensure the backend knows the correct host
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
|
||||
# Correct base_url
|
||||
absolute_redirect off;
|
||||
sub_filter_once off;
|
||||
sub_filter_types *;
|
||||
sub_filter %%base_subpath%% /;
|
||||
|
||||
}
|
||||
# Rewrite URLs in the response
|
||||
sub_filter localhost:9000 %%BASE_URL%%;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user