2023-07-10 13:48:38 +00:00
|
|
|
# NGINX reverse proxy setup
|
2021-01-28 21:04:37 +00:00
|
|
|
|
2022-01-04 16:42:52 +00:00
|
|
|
This is a very basic config, secured with Let's Encrypt. Any log is disabled by default. Do not forget to replace `server_name` with your domain.
|
2020-04-16 12:13:41 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
2024-06-22 07:26:15 +00:00
|
|
|
listen 443 ssl;
|
|
|
|
listen [::]:443 ssl;
|
|
|
|
http2 on;
|
2020-04-16 12:13:41 +00:00
|
|
|
|
|
|
|
server_name invidious.domain.tld;
|
|
|
|
|
|
|
|
access_log off;
|
|
|
|
error_log /var/log/nginx/error.log crit;
|
|
|
|
|
|
|
|
ssl_certificate /etc/letsencrypt/live/invidious.domain.tld/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/invidious.domain.tld/privkey.pem;
|
|
|
|
|
|
|
|
location / {
|
2022-08-20 19:13:14 +00:00
|
|
|
proxy_pass http://127.0.0.1:3000;
|
2020-04-16 12:13:41 +00:00
|
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
2020-06-20 00:28:49 +00:00
|
|
|
proxy_set_header Host $host; # so Invidious knows domain
|
2020-04-16 12:13:41 +00:00
|
|
|
proxy_http_version 1.1; # to keep alive
|
|
|
|
proxy_set_header Connection ""; # to keep alive
|
|
|
|
}
|
|
|
|
|
2020-06-20 00:28:49 +00:00
|
|
|
if ($https = '') { return 301 https://$host$request_uri; } # if not connected to HTTPS, perma-redirect to HTTPS
|
2020-04-16 12:13:41 +00:00
|
|
|
}
|
2022-01-04 16:42:52 +00:00
|
|
|
```
|