added more api urls to immich
This commit is contained in:
+16
-30
@@ -481,41 +481,27 @@ metadata:
|
|||||||
|
|
||||||
set $geo_allowed 0;
|
set $geo_allowed 0;
|
||||||
|
|
||||||
|
# Allow private/local networks
|
||||||
|
if ($remote_addr ~ "^192\.168\.") { set $geo_allowed 1; }
|
||||||
|
if ($remote_addr ~ "^10\.") { set $geo_allowed 1; }
|
||||||
|
|
||||||
# Allow all Hungarian traffic
|
# Allow all Hungarian traffic
|
||||||
if ($geoip2_country_code = "HU") {
|
if ($geoip2_country_code = "HU") { set $geo_allowed 1; }
|
||||||
set $geo_allowed 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Allow public share paths from anywhere
|
# Public share paths
|
||||||
if ($request_uri ~* "^/share/") {
|
if ($request_uri ~* "^/share") { set $geo_allowed 1; }
|
||||||
set $geo_allowed 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
# API endpoints needed for shared content
|
# API endpoints needed for shares
|
||||||
if ($request_uri ~* "^/api/shared-links") {
|
if ($request_uri ~* "^/api/shared-links") { set $geo_allowed 1; }
|
||||||
set $geo_allowed 1;
|
if ($request_uri ~* "^/api/assets") { set $geo_allowed 1; }
|
||||||
}
|
if ($request_uri ~* "^/api/albums") { set $geo_allowed 1; }
|
||||||
|
if ($request_uri ~* "^/api/server") { set $geo_allowed 1; }
|
||||||
|
if ($request_uri ~* "^/api/users/me") { set $geo_allowed 1; }
|
||||||
|
|
||||||
# Assets for shared albums (thumbnails and originals)
|
# Static assets
|
||||||
if ($request_uri ~* "^/api/assets/.*/thumbnail") {
|
if ($request_uri ~* "^/_app/") { set $geo_allowed 1; }
|
||||||
set $geo_allowed 1;
|
if ($request_uri ~* "\.(js|css|woff2?|ttf|svg|png|ico|jpg|jpeg|webp)$") { set $geo_allowed 1; }
|
||||||
}
|
|
||||||
if ($request_uri ~* "^/api/assets/.*/original") {
|
|
||||||
set $geo_allowed 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Static assets needed for share page rendering
|
|
||||||
if ($request_uri ~* "^/_app/") {
|
|
||||||
set $geo_allowed 1;
|
|
||||||
}
|
|
||||||
if ($request_uri ~* "^/favicon") {
|
|
||||||
set $geo_allowed 1;
|
|
||||||
}
|
|
||||||
if ($request_uri ~* "\.(js|css|woff2?|ttf|svg|png|ico)$") {
|
|
||||||
set $geo_allowed 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Block non-allowed requests
|
|
||||||
if ($geo_allowed = 0) {
|
if ($geo_allowed = 0) {
|
||||||
return 403 "Access restricted to Hungary";
|
return 403 "Access restricted to Hungary";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user