mirror of
https://github.com/iv-org/documentation.git
synced 2025-11-23 17:13:17 -05:00
chore: add captions endpoint + rework nginx config
This commit is contained in:
parent
baf62898f3
commit
eafb7fe65f
4 changed files with 30 additions and 42 deletions
|
|
@ -66,6 +66,8 @@ To make the VirtualHost config below actually work, you should as well:
|
||||||
ProxyPassReverse /latest_version http://127.0.0.1:8282/
|
ProxyPassReverse /latest_version http://127.0.0.1:8282/
|
||||||
ProxyPass /api/manifest/dash/id/ http://127.0.0.1:8282/ nocanon
|
ProxyPass /api/manifest/dash/id/ http://127.0.0.1:8282/ nocanon
|
||||||
ProxyPassReverse /api/manifest/dash/id/ http://127.0.0.1:8282/
|
ProxyPassReverse /api/manifest/dash/id/ http://127.0.0.1:8282/
|
||||||
|
ProxyPass /api/v1/captions/ http://127.0.0.1:8282/ nocanon
|
||||||
|
ProxyPassReverse /api/v1/captions/ http://127.0.0.1:8282/
|
||||||
ProxyPass /videoplayback http://127.0.0.1:8282/ nocanon
|
ProxyPass /videoplayback http://127.0.0.1:8282/ nocanon
|
||||||
ProxyPassReverse /videoplayback http://127.0.0.1:8282/
|
ProxyPassReverse /videoplayback http://127.0.0.1:8282/
|
||||||
ProxyPreserveHost On
|
ProxyPreserveHost On
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ https://<server_name> {
|
||||||
path /latest_version
|
path /latest_version
|
||||||
path /api/manifest/dash/id/*
|
path /api/manifest/dash/id/*
|
||||||
path /videoplayback*
|
path /videoplayback*
|
||||||
|
/api/v1/captions/*
|
||||||
}
|
}
|
||||||
|
|
||||||
reverse_proxy @companion localhost:8282
|
reverse_proxy @companion localhost:8282
|
||||||
|
|
|
||||||
|
|
@ -4,52 +4,37 @@ This is a very basic config, secured with Let's Encrypt. Any log is disabled by
|
||||||
|
|
||||||
```
|
```
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
listen 443 ssl;
|
listen 443 ssl http2;
|
||||||
listen [::]:443 ssl;
|
listen [::]:443 ssl http2;
|
||||||
http2 on;
|
|
||||||
|
|
||||||
server_name invidious.domain.tld;
|
server_name invidious.domain.tld;
|
||||||
|
|
||||||
access_log off;
|
access_log off;
|
||||||
error_log /var/log/nginx/error.log crit;
|
error_log /var/log/nginx/error.log crit;
|
||||||
|
|
||||||
ssl_certificate /etc/letsencrypt/live/invidious.domain.tld/fullchain.pem;
|
ssl_certificate /etc/letsencrypt/live/invidious.domain.tld/fullchain.pem;
|
||||||
ssl_certificate_key /etc/letsencrypt/live/invidious.domain.tld/privkey.pem;
|
ssl_certificate_key /etc/letsencrypt/live/invidious.domain.tld/privkey.pem;
|
||||||
|
|
||||||
location / {
|
# Redirect all HTTP requests to HTTPS
|
||||||
proxy_pass http://127.0.0.1:3000;
|
if ($scheme = http) {
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
return 301 https://$host$request_uri;
|
||||||
proxy_set_header Host $host; # so Invidious knows domain
|
}
|
||||||
proxy_http_version 1.1; # to keep alive
|
|
||||||
proxy_set_header Connection ""; # to keep alive
|
|
||||||
}
|
|
||||||
|
|
||||||
location /latest_version {
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_pass http://127.0.0.1:8282;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Host $host; # so Invidious companion knows domain
|
proxy_set_header Connection "";
|
||||||
proxy_http_version 1.1; # to keep alive
|
|
||||||
proxy_set_header Connection ""; # to keep alive
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api/manifest/dash/id/ {
|
# Invidious main service
|
||||||
proxy_pass http://127.0.0.1:8282;
|
location / {
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_pass http://127.0.0.1:3000;
|
||||||
proxy_set_header Host $host; # so Invidious companion knows domain
|
}
|
||||||
proxy_http_version 1.1; # to keep alive
|
|
||||||
proxy_set_header Connection ""; # to keep alive
|
|
||||||
}
|
|
||||||
|
|
||||||
location /videoplayback {
|
# Invidious companion service (multiple paths, same backend)
|
||||||
proxy_pass http://127.0.0.1:8282;
|
location ~ ^/(latest_version|videoplayback|api/(v1/captions|manifest/dash/id))/ {
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_pass http://127.0.0.1:8282;
|
||||||
proxy_set_header Host $host; # so Invidious companion knows domain
|
}
|
||||||
proxy_http_version 1.1; # to keep alive
|
|
||||||
proxy_set_header Connection ""; # to keep alive
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($https = '') { return 301 https://$host$request_uri; } # if not connected to HTTPS, perma-redirect to HTTPS
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ Do not forget to replace `<server_name>` with your domain.
|
||||||
...
|
...
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.invidious.rule=Host(`<server_name>`) && !(Path(`/latest_version`) || PathPrefix(`/api/manifest/dash/id/`) || PathPrefix(`/videoplayback`))"
|
- "traefik.http.routers.invidious.rule=Host(`<server_name>`) && !(Path(`/latest_version`) || PathPrefix(`/api/manifest/dash/id/`) || PathPrefix(`/api/v1/captions/`) || PathPrefix(`/videoplayback`))"
|
||||||
- "traefik.http.routers.invidious.entrypoints=web-sec"
|
- "traefik.http.routers.invidious.entrypoints=web-sec"
|
||||||
- "traefik.http.routers.invidious.tls.certresolver=le"
|
- "traefik.http.routers.invidious.tls.certresolver=le"
|
||||||
- "traefik.http.services.invidious.loadbalancer.server.port=3000"
|
- "traefik.http.services.invidious.loadbalancer.server.port=3000"
|
||||||
|
|
@ -19,7 +19,7 @@ Do not forget to replace `<server_name>` with your domain.
|
||||||
...
|
...
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.invidious-companion.rule=Host(`<server_name>`) && (Path(`/latest_version`) || PathPrefix(`/api/manifest/dash/id/`) || PathPrefix(`/videoplayback`))"
|
- "traefik.http.routers.invidious-companion.rule=Host(`<server_name>`) && (Path(`/latest_version`) || PathPrefix(`/api/manifest/dash/id/`) || PathPrefix(`/api/v1/captions/`) || PathPrefix(`/videoplayback`))"
|
||||||
- "traefik.http.routers.invidious-companion.entrypoints=web-sec"
|
- "traefik.http.routers.invidious-companion.entrypoints=web-sec"
|
||||||
- "traefik.http.routers.invidious-companion.tls.certresolver=le"
|
- "traefik.http.routers.invidious-companion.tls.certresolver=le"
|
||||||
- "traefik.http.services.invidious-companion.loadbalancer.server.port=8282"
|
- "traefik.http.services.invidious-companion.loadbalancer.server.port=8282"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue