mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 02:11:01 +01:00
Update ingress.conf
This commit is contained in:
@@ -3,59 +3,23 @@ server {
|
||||
include /etc/nginx/includes/server_params.conf;
|
||||
include /etc/nginx/includes/proxy_params.conf;
|
||||
client_max_body_size 0;
|
||||
server_name photoprism.*;
|
||||
|
||||
add_header 'Referrer-Policy' 'no-referrer';
|
||||
proxy_set_header Range $http_range;
|
||||
proxy_set_header If-Range $http_if_range;
|
||||
# Code origin : https://github.com/transmission/transmission/issues/899
|
||||
|
||||
location / {
|
||||
|
||||
# Proxy
|
||||
proxy_pass http://127.0.0.1:9091;
|
||||
|
||||
proxy_read_timeout 300;
|
||||
proxy_redirect off;
|
||||
proxy_buffering off; # Do not hold back the request while the client sends data, give the stream directly to PP
|
||||
proxy_set_header X-Real-IP $remote_addr; # Let PP know the clients real IP
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Let PP know that a proxy did forward this request
|
||||
proxy_set_header Host $http_host; # Set Proxy host info
|
||||
|
||||
# Websockets
|
||||
proxy_http_version 1.1; # Required for WebSocket connection
|
||||
proxy_set_header Upgrade $http_upgrade; # Allow protocol switch to websocket
|
||||
proxy_set_header Connection "Upgrade"; # Do protocol switch
|
||||
proxy_set_header X-Forwarded-Proto $scheme; # Let PP know that this connection used HTTP or HTTPS
|
||||
|
||||
# Rewrite url
|
||||
sub_filter_once off;
|
||||
sub_filter_types *;
|
||||
sub_filter "/browse" "%%ingress_entry%%/browse";
|
||||
sub_filter "/static" "%%ingress_entry%%/static";
|
||||
sub_filter "/api/v1" "%%ingress_entry%%/api/v1";
|
||||
sub_filter "/api/v1%%ingress_entry%%" "%%ingress_entry%%/api/v1";
|
||||
|
||||
# Allow frames
|
||||
proxy_hide_header "Content-Security-Policy";
|
||||
add_header X-Frame-Options SAMEORIGIN;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
proxy_set_header Accept-Encoding "";
|
||||
|
||||
# REMOVED
|
||||
#sub_filter "/auth" "%%ingress_entry%%/auth";
|
||||
#sub_filter "/manifest.json" "%%ingress_entry%%/manifest.json";
|
||||
#sub_filter "/albums" "%%ingress_entry%%/albums";
|
||||
#sub_filter "/videos" "%%ingress_entry%%/videos";
|
||||
#sub_filter "/people" "%%ingress_entry%%/people";
|
||||
#sub_filter "/favorites" "%%ingress_entry%%/favorites";
|
||||
#sub_filter "/moments" "%%ingress_entry%%/moments";
|
||||
#sub_filter "/calendar" "%%ingress_entry%%/calendar";
|
||||
#sub_filter "/places" "%%ingress_entry%%/places";
|
||||
#sub_filter "/labels" "%%ingress_entry%%/labels";
|
||||
#sub_filter "/folders" "%%ingress_entry%%/folders";
|
||||
#sub_filter "/private" "%%ingress_entry%%/private";
|
||||
#sub_filter "/library" "%%ingress_entry%%/library";
|
||||
#sub_filter "/settings" "%%ingress_entry%%/settings";
|
||||
return 301 /web/; # The slash at the end is important
|
||||
}
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:9091/transmission/;
|
||||
proxy_redirect off;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Host $remote_addr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user