From ddcff48f5bf3e0d9b2ce62496661ae6724bc48d8 Mon Sep 17 00:00:00 2001 From: Matthew Northcott Date: Fri, 3 Feb 2023 09:24:35 +1300 Subject: [PATCH] Update nginx.conf --- nginx.conf | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/nginx.conf b/nginx.conf index d80c8bc..882491c 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,24 +1,36 @@ +events { + worker_connections 512; +} + http { server { listen 80; - include /etc/nginx/mime.types; - proxy_set_header Host $http_host; + include /etc/nginx/mime.types; location / { - proxy_pass http://frontend:3000; + proxy_pass http://frontend:3000; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; } location /staticfiles { - root /etc/nginx/html/; + root /etc/nginx/html/; } - location ~* ^/(api|admin) { + location ~ ^/(api|admin) { proxy_pass http://backend:8000; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } + + location ~* \.(eot|otf|ttf|woff|woff2)$ { + add_header Access-Control-Allow-Origin *; } } } - - -events { - # configuration of connection processing -} -- 2.45.2