mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
40 lines
925 B
Plaintext
40 lines
925 B
Plaintext
server {
|
|
listen %%interface%%:%%port%% default_server;
|
|
|
|
include /etc/nginx/includes/server_params.conf;
|
|
include /etc/nginx/includes/proxy_params.conf;
|
|
|
|
client_max_body_size 0;
|
|
|
|
root /opt/scrutiny/web;
|
|
|
|
if ($http_referer ~* "^(http[s]?)://([^:]+):(\d*)(/.*)$") {
|
|
set $x_scheme $1;
|
|
set $x_host $2;
|
|
set $x_port $3;
|
|
}
|
|
|
|
if ($http_referer ~* "^(http[s]?)://([^:]+)(/.*)$") {
|
|
set $x_scheme $1;
|
|
set $x_host $2;
|
|
set $x_port "";
|
|
}
|
|
|
|
location = / {
|
|
return 301 $x_scheme://$host:$x_port%%ingress_entry%%/web/dashboard;
|
|
}
|
|
|
|
location /api {
|
|
add_header Access-Control-Allow-Origin *;
|
|
proxy_read_timeout 30;
|
|
proxy_pass http://backend/api;
|
|
}
|
|
|
|
location /web/ {
|
|
add_header Access-Control-Allow-Origin *;
|
|
proxy_read_timeout 30;
|
|
proxy_pass http://backend/web/;
|
|
}
|
|
|
|
}
|