165 lines
4.1 KiB
Plaintext
165 lines
4.1 KiB
Plaintext
# Rate limit searches, just 5 per sec
|
|
limit_req_zone $binary_remote_addr zone=invidious:10m rate=5r/s;
|
|
# Rate limit api requests, just 60 per sec, wathcing a normal video does like
|
|
# 3 to 4 api requests so you don't need more than 30 in a second unless is a bot spamming shit lol
|
|
limit_req_zone $binary_remote_addr zone=invidiousapi:10m rate=40r/s;
|
|
|
|
upstream inv {
|
|
server 127.0.0.1:40015 max_fails=3 fail_timeout=3s;
|
|
server 127.0.0.1:40016 max_fails=3 fail_timeout=3s;
|
|
server 127.0.0.1:40017 max_fails=3 fail_timeout=3s;
|
|
}
|
|
|
|
upstream http3-ytproxy {
|
|
server unix:/opt/http3-ytproxy/socket/http-proxy-1.sock;
|
|
server unix:/opt/http3-ytproxy/socket/http-proxy-2.sock;
|
|
server unix:/opt/http3-ytproxy/socket/http-proxy-3.sock;
|
|
}
|
|
|
|
# CLEARNET
|
|
server {
|
|
access_log /var/log/nginx/inv.access.log limited;
|
|
error_log /var/log/nginx/inv.error.log;
|
|
server_name inv.zzls.xyz;
|
|
include configs/general.conf;
|
|
include configs/robotsNone.conf;
|
|
include snippets/spys.me.proxies.blacklist.conf;
|
|
|
|
location @upstream {
|
|
proxy_pass http://inv;
|
|
include configs/proxy.conf;
|
|
limit_rate 8000k;
|
|
# Disable buffering and cache so i don't kill my
|
|
# SSD and bandwidth usage
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
proxy_cache off;
|
|
proxy_intercept_errors on;
|
|
error_page 502 = @fallback;
|
|
}
|
|
|
|
location ~ (^/videoplayback|^/vi/|^/ggpht/|^/sb/) {
|
|
# Woops! Sorry. I don't want to kill my SSD lol!
|
|
proxy_buffering off;
|
|
#proxy_buffers 1024 16k;
|
|
proxy_set_header X-Forwarded-For "";
|
|
proxy_hide_header "alt-svc";
|
|
sendfile_max_chunk 512k;
|
|
proxy_hide_header Cache-Control;
|
|
proxy_hide_header etag;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection keep-alive;
|
|
proxy_max_temp_file_size 32m;
|
|
proxy_pass http://http3-ytproxy;
|
|
add_header Cache-Control private always;
|
|
|
|
}
|
|
|
|
location / {
|
|
try_files $uri @upstream;
|
|
}
|
|
|
|
location /search {
|
|
try_files $uri @upstream;
|
|
# limit_req zone=invidious;
|
|
}
|
|
|
|
location /api {
|
|
try_files $uri @upstream;
|
|
#limit_req zone=invidiousapi;
|
|
}
|
|
|
|
location /api/v1/storyboards {
|
|
try_files $uri @upstream;
|
|
}
|
|
|
|
location /api/v1/captions {
|
|
try_files $uri @upstream;
|
|
}
|
|
|
|
location /api/v1/comments {
|
|
try_files $uri @upstream;
|
|
}
|
|
|
|
location ~ ^/api/v1/channels/(.+)/shorts {
|
|
try_files $uri @upstream;
|
|
}
|
|
|
|
location @fallback {
|
|
root /etc/nginx/errors;
|
|
try_files $uri /502.html = 502;
|
|
}
|
|
|
|
# QUIC
|
|
add_header Alt-Svc 'h3=":443"; ma=86400';
|
|
|
|
# TOR
|
|
add_header Onion-Location http://inv.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion$request_uri;
|
|
|
|
listen 443 ssl;
|
|
listen 443 quic;
|
|
http2 on;
|
|
include configs/ssl.conf;
|
|
|
|
}
|
|
|
|
# TOR
|
|
server {
|
|
listen 80;
|
|
server_name inv.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion;
|
|
include configs/general.conf;
|
|
include configs/robotsNone.conf;
|
|
|
|
location @upstream {
|
|
proxy_pass http://inv;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header Host $host; # so Invidious knows domain
|
|
proxy_http_version 1.1; # to keep alive
|
|
proxy_set_header Connection ""; # to keep alive
|
|
limit_rate 8000k;
|
|
# Disable buffering and cache so i don't kill my
|
|
# SSD and bandwidth usage
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
proxy_cache off;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri @upstream;
|
|
}
|
|
}
|
|
|
|
# I2P
|
|
server {
|
|
listen 30003;
|
|
server_name zzlsbhhfvwg3oh36tcvx4r7n6jrw7zibvyvfxqlodcwn3mfrvzuq.b32.i2p;
|
|
include configs/general.conf;
|
|
include configs/robotsNone.conf;
|
|
|
|
location @upstream {
|
|
proxy_pass http://inv;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header Host $host; # so Invidious knows domain
|
|
proxy_http_version 1.1; # to keep alive
|
|
proxy_set_header Connection ""; # to keep alive
|
|
limit_rate 8000k;
|
|
# Disable buffering and cache so i don't kill my
|
|
# SSD and bandwidth usage
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
proxy_cache off;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri @upstream;
|
|
}
|
|
}
|
|
|
|
server {
|
|
if ($host = inv.zzls.xyz) {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
listen 80;
|
|
server_name inv.zzls.xyz;
|
|
}
|