mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-03 16:00:29 +01:00
Ingress fix
https://github.com/alexbelgium/hassio-addons/issues/588 https://github.com/alexbelgium/hassio-addons/issues/589
This commit is contained in:
@@ -42,7 +42,6 @@
|
||||
"environment": {
|
||||
"PHOTOPRISM_ADMIN_PASSWORD": "please_change_password",
|
||||
"PHOTOPRISM_ADMIN_USER": "admin",
|
||||
"PHOTOPRISM_HTTP_COMPRESSION": "none",
|
||||
"PHOTOPRISM_HTTP_PORT": "2341",
|
||||
"working_dir": "/data/photoprism"
|
||||
},
|
||||
@@ -101,5 +100,5 @@
|
||||
],
|
||||
"slug": "photoprism",
|
||||
"url": "https://github.com/alexbelgium/hassio-addons-test",
|
||||
"version": "20220121-3"
|
||||
}
|
||||
"version": "20220121-4"
|
||||
}
|
||||
@@ -13,6 +13,4 @@ ingress_entry=$(bashio::addon.ingress_entry)
|
||||
sed -i "s/%%port%%/${ingress_port}/g" /etc/nginx/servers/ingress.conf
|
||||
sed -i "s/%%interface%%/${ingress_interface}/g" /etc/nginx/servers/ingress.conf
|
||||
sed -i "s|%%ingress_entry%%|${ingress_entry}|g" /etc/nginx/servers/ingress.conf
|
||||
|
||||
# Avoid error message
|
||||
grep -rnl "PhotoPrism has been updated…" /opt/photoprism | xargs sed -i "s|PhotoPrism has been updated…|Please click cancel|g"
|
||||
sed -i "s|%%ingress_entry%%|${ingress_entry}|g" /etc/nginx/servers/ssl.conf
|
||||
|
||||
@@ -57,6 +57,13 @@ case $(bashio::config 'DB_TYPE') in
|
||||
;;
|
||||
esac
|
||||
|
||||
############
|
||||
# Base url #
|
||||
############
|
||||
|
||||
PHOTOPRISM_SITE_URL="$(bashio::addon.ingress_entry)/"
|
||||
export PHOTOPRISM_SITE_URL
|
||||
|
||||
##############
|
||||
# LAUNCH APP #
|
||||
##############
|
||||
|
||||
@@ -10,9 +10,8 @@ server {
|
||||
proxy_set_header If-Range $http_if_range;
|
||||
|
||||
location / {
|
||||
|
||||
# Proxy
|
||||
proxy_pass http://127.0.0.1:2341;
|
||||
proxy_pass http://127.0.0.1:2341%%ingress_entry%%/;
|
||||
|
||||
proxy_read_timeout 300;
|
||||
proxy_redirect off;
|
||||
@@ -27,35 +26,12 @@ server {
|
||||
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";
|
||||
proxy_hide_header 'x-frame-options'; # Allow frames
|
||||
proxy_hide_header "Content-Security-Policy";
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
proxy_set_header Accept-Encoding "";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ server {
|
||||
include /etc/nginx/includes/server_params.conf;
|
||||
include /etc/nginx/includes/proxy_params.conf;
|
||||
client_max_body_size 0;
|
||||
location / {
|
||||
set $upstream_port 2341;
|
||||
proxy_pass http://127.0.0.1:$upstream_port;
|
||||
}
|
||||
location /ubooquity/ {
|
||||
set $upstream_port 2341;
|
||||
proxy_pass http://127.0.0.1:$upstream_port;
|
||||
|
||||
location = / {
|
||||
return 301 %%ingress_entry%%/;
|
||||
}
|
||||
|
||||
location %%ingress_entry%%/ {
|
||||
set $upstream_port 2341;
|
||||
proxy_pass http://127.0.0.1:$upstream_port;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user