From 26c5ef39f47883fa76a2ed32080e29f3c7256ccf Mon Sep 17 00:00:00 2001 From: Thomas Rogers Date: Thu, 31 Oct 2024 12:35:56 +0100 Subject: [PATCH] Added an NGINX Example file --- self-hosting/nginx/nginx.conf | 69 +++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 self-hosting/nginx/nginx.conf diff --git a/self-hosting/nginx/nginx.conf b/self-hosting/nginx/nginx.conf new file mode 100644 index 000000000..46cf041f6 --- /dev/null +++ b/self-hosting/nginx/nginx.conf @@ -0,0 +1,69 @@ +events {} + +http { + sendfile on; + keepalive_timeout 60; + + upstream omnivore_web { + ip_hash; + server 127.0.0.1:3000; + } + + upstream omnivore_backend { + ip_hash; + server 127.0.0.1:4000; + } + + upstream omnivore_imageproxy { + ip_hash; + server 127.0.0.1:1010; + } + + upstream omnivore_bucket { + ip_hash; + server 127.0.0.1:7070; + } + + server { + listen 80; + return 301 https://$host$request_uri + } + + server { + listen 443; + + ssl_certification /path/to/cert.crt; + ssl_certificate_key /path/to/cert.key; + + ssl on; + ssl_session_cache builtin:1000 shared:SSL:10m; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4; + ssl_prefer_server_ciphers on; + + # Override for authentication on the frontend + location /api/client/auth { + proxy_pass http://omnivore_web; + } + + # API + location /api { + proxy_pass http://omnivore_backend; + } + + # Minio + location /bucket { + proxy_pass http://omnivore_bucket; + } + + # ImageProxy + location /images { + proxy_pass http://omnivore_imageproxy; + } + + # FrontEnd application + location / { + proxy_pass http://omnivore_web; + } + } +}