From ba6794fb99a85d5beab88fc9fbe6dfee7bd2ad19 Mon Sep 17 00:00:00 2001 From: vajonam <152501+vajonam@users.noreply.github.com> Date: Sun, 23 Apr 2023 08:38:21 -0400 Subject: [PATCH] adding instructions for Nginix reverse proxy (#6159) * adding instructions for Nginix reverse proxy adding an example of subdomain reverse proxy for nginx * Update docs/docs/guides/reverse_proxy.md Co-authored-by: Nicolas Mowen * Update docs/docs/guides/reverse_proxy.md Co-authored-by: Nicolas Mowen * add some descriptions for steps add more information on each of the reverse proxy sections. * cleanup --------- Co-authored-by: Nicolas Mowen Co-authored-by: Blake Blackshear --- docs/docs/guides/reverse_proxy.md | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/docs/docs/guides/reverse_proxy.md b/docs/docs/guides/reverse_proxy.md index 2e284eede..165b4d517 100644 --- a/docs/docs/guides/reverse_proxy.md +++ b/docs/docs/guides/reverse_proxy.md @@ -84,3 +84,61 @@ There are many ways to authenticate a website but a straightforward approach is ``` + +## Nginx Reverse Proxy + +This method shows a working example for subdomain type reverse proxy with SSL enabled. + +### Setup server and port to reverse proxy + +This is set in `$server` and `$port` this should match your ports you have exposed to your docker container. Optionally you listen on port `443` and enable `SSL` + +``` +# ------------------------------------------------------------ +# frigate.domain.com +# ------------------------------------------------------------ + +server { + set $forward_scheme http; + set $server "192.168.100.2"; # FRIGATE SERVER LOCATION + set $port 5000; + + listen 80; + listen 443 ssl http2; + + server_name frigate.domain.com; +} +``` + +### Setup SSL (optional) + +This section points to your SSL files, the example below shows locations to a default Lets Encrypt SSL certificate. + +``` + # Let's Encrypt SSL + include conf.d/include/letsencrypt-acme-challenge.conf; + include conf.d/include/ssl-ciphers.conf; + ssl_certificate /etc/letsencrypt/live/npm-1/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/npm-1/privkey.pem; +``` + + +### Setup reverse proxy settings + +Thhe settings below enabled connection upgrade, sets up logging (optional) and proxies everything from the `/` context to the docker host and port specified earlier in the configuration + +``` + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $http_connection; + proxy_http_version 1.1; + + access_log /data/logs/proxy-host-40_access.log proxy; + error_log /data/logs/proxy-host-40_error.log warn; + + location / { + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $http_connection; + proxy_http_version 1.1; + } + +```