From 33f88938f67abb4a696569b12ccdad299f367701 Mon Sep 17 00:00:00 2001 From: Mark Harding Date: Wed, 17 Apr 2024 12:01:12 +0100 Subject: [PATCH] (feat): sockets server updates --- containers/nginx/dev-ssr.conf.tpl | 25 ++++++++++++++++++++++++- docker-compose.yml | 10 +++++++--- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/containers/nginx/dev-ssr.conf.tpl b/containers/nginx/dev-ssr.conf.tpl index 36d60aa12..f81ee5782 100644 --- a/containers/nginx/dev-ssr.conf.tpl +++ b/containers/nginx/dev-ssr.conf.tpl @@ -6,6 +6,8 @@ map $http_upgrade $connection_upgrade { server { resolver ${DOCKER_RESOLVER} ipv6=off; + large_client_header_buffers 4 16k; + listen 80; listen [::]:80 default ipv6only=on; listen 8080; @@ -80,7 +82,7 @@ server { port_in_redirect off; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host localhost:8080; + proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_set_header X-Minds-Locale $locale; proxy_pass $upstream; @@ -105,6 +107,27 @@ server { log_not_found off; } + location /plugins/embedded-comments { + alias /var/www/Minds/embedded-comments/build; + index index.html; + + add_header 'Access-Control-Allow-Origin' "$http_origin"; + add_header 'Access-Control-Allow-Credentials' 'true'; + } + + location ^~ /api/sockets/ { + set $upstream http://sockets:3000; + + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + + proxy_pass $upstream; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } + location ~ ^(/api|/fs|/icon|/carousel|/emails/unsubscribe|/.well-known|/manifest.webmanifest) { add_header 'Access-Control-Allow-Origin' "$http_origin"; add_header 'Access-Control-Allow-Credentials' 'true'; diff --git a/docker-compose.yml b/docker-compose.yml index 01c9f5e11..f44609825 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -80,9 +80,11 @@ services: - keys:/.dev sockets: - image: minds/sockets + build: + context: ./sockets + dockerfile: ./Dockerfile environment: - - PORT=3030 + - PORT=3000 - REDIS_HOST=redis - REDIS_PORT=6379 - JWT_SECRET= @@ -93,8 +95,10 @@ services: depends_on: - redis - cassandra + volumes: + - keys:/.dev ports: - - 8010:3030 + - 3000:3000 ## Vault