Skip to content

Commit

Permalink
(feat): sockets server updates
Browse files Browse the repository at this point in the history
  • Loading branch information
markharding committed Apr 17, 2024
1 parent 9397c91 commit 33f8893
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
25 changes: 24 additions & 1 deletion containers/nginx/dev-ssr.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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';
Expand Down
10 changes: 7 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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=<!!! set this to jwt-token in your engine/settings.php !!!>
Expand All @@ -93,8 +95,10 @@ services:
depends_on:
- redis
- cassandra
volumes:
- keys:/.dev
ports:
- 8010:3030
- 3000:3000

## Vault

Expand Down

0 comments on commit 33f8893

Please sign in to comment.