180 lines
4.5 KiB
Text
180 lines
4.5 KiB
Text
map $host $invidious_backend {
|
|
default inv;
|
|
inv1.nadeko.net invidious-1;
|
|
inv2.nadeko.net invidious-2;
|
|
inv3.nadeko.net invidious-3;
|
|
inv4.nadeko.net invidious-4;
|
|
inv5.nadeko.net invidious-5;
|
|
}
|
|
|
|
map $invidious_backend $cache_case {
|
|
default "";
|
|
inv $cookie_INVIDIOUS_SERVER_ID;
|
|
invidious-* $invidious_backend;
|
|
}
|
|
|
|
# CLEARNET
|
|
server {
|
|
error_log /var/log/nginx/inv.nadeko.net.error.log;
|
|
server_name
|
|
inv.nadeko.net
|
|
~^inv([1-5])\.nadeko\.net$
|
|
inv.nadekonw7plitnjuawu6ytjsl7jlglk2t6pyq6eftptmiv3dvqndwvyd.onion ~^inv([1-5])\.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;
|
|
}
|
|
|
|
# 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;
|
|
access_log /var/log/nginx/inv.nadeko.net.feed.access.log;
|
|
server_name feed-inv.nadeko.net;
|
|
include configs/listen.conf;
|
|
include configs/robotsNone.conf;
|
|
|
|
# The messed up invidious configuration
|
|
include http.d/locations/inv-feed.conf;
|
|
}
|
|
|
|
server {
|
|
server_name inv-cl1.nadeko.net;
|
|
include configs/listen.conf;
|
|
include configs/robotsNone.conf;
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:10080;
|
|
include configs/proxy.conf;
|
|
}
|
|
}
|