prevent redefinition of error_page on the invidious location config

This commit is contained in:
Fijxu 2025-02-11 20:29:56 -03:00
parent 7f132979c4
commit a85fbf5d1e
2 changed files with 6 additions and 116 deletions

View file

@ -13,7 +13,8 @@ map $invidious_backend $cache_case {
invidious-* $invidious_backend;
}
# CLEARNET
# CLEARNET TOR AND I2P
# (Tor and I2P listens on 4080, defined on configs/listen.conf)
server {
error_log /var/log/nginx/inv.nadeko.net.error.log;
server_name
@ -31,11 +32,13 @@ server {
if ($http_user_agent = "") {
return 444;
}
if ($request_method = OPTIONS) {
return 204;
}
error_page 502 /502.html;
error_page 503 /503.html;
#rewrite_by_lua_file conf/lua/rewrite-invidious/init.lua;
location = /503.html {
@ -49,113 +52,8 @@ server {
location = /switchbackend {
content_by_lua_file conf/lua/switchbackend.lua;
}
# header_filter_by_lua_block {
# ngx.header["Onion-Location"] = "http://inv.nadekonw7plitnjuawu6ytjsl7jlglk2t6pyq6eftptmiv3dvqndwvyd.onion" .. ngx.var.request_uri
# }
listen 10040;
}
# TOR
# server {
# listen 10040;
#
# error_log /var/log/nginx/inv.nadeko.net.tor.error.log;
# #access_log /var/log/nginx/inv.nadeko.net.tor.access.log;
# server_name inv.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion inv.nadekonw7plitnjuawu6ytjsl7jlglk2t6pyq6eftptmiv3dvqndwvyd.onion;
# include configs/listen.conf;
# #include configs/general.conf;
# #include configs/robotsNone.conf;
#
# include http.d/locations/inv-tor.conf;
#
# rewrite_by_lua_file conf/lua/rewrite-invidious/init.lua;
#
# location = /503.html {
# content_by_lua_file conf/lua/503-invidious.lua;
# }
#
# location = /502.html {
# content_by_lua_file conf/lua/502-invidious.lua;
# }
#
# location = /switchbackend {
# content_by_lua_file conf/lua/switchbackend.lua;
# }
# }
# TOR
# server {
# error_log /var/log/nginx/inv.nadeko.net.tor.error.log;
# #access_log /var/log/nginx/inv.nadeko.net.tor.access.log;
# server_name inv.nadekonw7plitnjuawu6ytjsl7jlglk2t6pyq6eftptmiv3dvqndwvyd.onion;
# include configs/listen.conf;
# include configs/robotsNone.conf;
# # MAINTENANCE MODE
# # include configs/maintenance-mode.conf;
#
# # The messed up invidious configuration
# include http.d/locations/inv.conf;
#
# if ($http_user_agent = "") {
# return 444;
# }
#
# if ($request_method = OPTIONS) {
# return 204;
# }
#
# rewrite_by_lua_file conf/lua/rewrite-invidious/init.lua;
#
# location = /503.html {
# content_by_lua_file conf/lua/503-invidious.lua;
# }
#
# location = /502.html {
# content_by_lua_file conf/lua/502-invidious.lua;
# }
#
# location = /switchbackend {
# content_by_lua_file conf/lua/switchbackend.lua;
# }
#
# listen 10040;
# }
# I2P
# server {
# error_log /var/log/nginx/inv.nadeko.net.i2p.error.log;
# access_log /var/log/nginx/inv.nadeko.net.i2p.access.log;
# server_name inv.zzls.i2p zzlsbhhfvwg3oh36tcvx4r7n6jrw7zibvyvfxqlodcwn3mfrvzuq.b32.i2p;
# include configs/listen.conf;
# include configs/robotsNone.conf;
# # MAINTENANCE MODE
# # include configs/maintenance-mode.conf;
#
# # The messed up invidious configuration
# include http.d/locations/inv.conf;
#
# if ($http_user_agent = "") {
# return 444;
# }
#
# rewrite_by_lua_file conf/lua/rewrite-invidious/init.lua;
#
# location = /503.html {
# content_by_lua_file conf/lua/503-invidious.lua;
# }
#
# location = /502.html {
# content_by_lua_file conf/lua/502-invidious.lua;
# }
#
# location = /switchbackend {
# content_by_lua_file conf/lua/switchbackend.lua;
# }
#
# listen 10051;
# }
# CLEARNET FEED
server {
error_log /var/log/nginx/inv.nadeko.net.feed.error.log;
@ -168,6 +66,7 @@ server {
include http.d/locations/inv-feed.conf;
}
# INVIDIOUS COMPANION
server {
server_name inv-cl1.nadeko.net;
include configs/listen.conf;

View file

@ -18,9 +18,6 @@ location @upstream {
proxy_http_version 1.1;
proxy_set_header Connection "";
error_page 502 /502.html;
error_page 503 /503.html;
if ($request_method = OPTIONS) {
return 204;
}
@ -57,9 +54,6 @@ location @upstream-api {
proxy_http_version 1.1;
proxy_set_header Connection "";
error_page 502 /502.html;
error_page 503 /503.html;
if ($request_method = OPTIONS) {
return 204;
}
@ -96,9 +90,6 @@ location @upstream-latest_version {
proxy_http_version 1.1;
proxy_set_header Connection "";
error_page 502 /502.html;
error_page 503 /503.html;
proxy_hide_header Access-Control-Allow-Origin;
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Allow-Origin "https://materialious.nadeko.net" always;