mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Enhance Nginx configuration for IP handling
Added a new location block for '/entry' to improve IP handling and set various proxy headers.
This commit is contained in:
@@ -6,6 +6,21 @@ server {
|
||||
|
||||
client_max_body_size 0;
|
||||
|
||||
location /entry {
|
||||
# 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;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
absolute_redirect off;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
return 302 %%INGRESS_URL%%/?ui_credentials=%7B%22host%22%3A%22$http_host%%INGRESS_URL%%/%22%2C%22port%22%3A%22%%PORT%%%22%2C%22pathPrefix%22%3A%22%%UIPATH%%%22%2C%22secretToken%22%3A%22%%TOKEN%%%22%7D;
|
||||
}
|
||||
|
||||
location / {
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
proxy_connect_timeout 30m;
|
||||
|
||||
Reference in New Issue
Block a user