2021-01-28 16:04:37 -05:00
|
|
|
---
|
|
|
|
title: NGINX-Reverse-Proxy
|
|
|
|
description:
|
|
|
|
published: true
|
2021-05-23 13:01:19 -04:00
|
|
|
date: 2021-05-23T16:59:09.054Z
|
2021-01-28 16:04:37 -05:00
|
|
|
tags:
|
2021-03-14 13:15:53 -04:00
|
|
|
editor: markdown
|
2021-01-28 16:04:37 -05:00
|
|
|
dateCreated: 2021-01-28T20:40:07.950Z
|
|
|
|
---
|
|
|
|
|
2020-04-16 08:13:41 -04: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.
|
|
|
|
|
|
|
|
```
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
|
|
|
listen 443 ssl http2;
|
|
|
|
listen [::]:443 ssl http2;
|
|
|
|
|
|
|
|
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 / {
|
|
|
|
proxy_pass http://127.0.0.1:3000/;
|
|
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
2020-06-19 20:28:49 -04:00
|
|
|
proxy_set_header Host $host; # so Invidious knows domain
|
2020-04-16 08:13:41 -04:00
|
|
|
proxy_http_version 1.1; # to keep alive
|
|
|
|
proxy_set_header Connection ""; # to keep alive
|
|
|
|
}
|
|
|
|
|
2020-06-19 20:28:49 -04:00
|
|
|
if ($https = '') { return 301 https://$host$request_uri; } # if not connected to HTTPS, perma-redirect to HTTPS
|
2020-04-16 08:13:41 -04:00
|
|
|
}
|
|
|
|
```
|