From 9918a6fe43a73a5d31cd373d0eb9a88ca46c44fd Mon Sep 17 00:00:00 2001 From: "Nathan.fooo" <86001920+appflowy@users.noreply.github.com> Date: Thu, 5 Oct 2023 22:32:19 +0800 Subject: [PATCH] chore: ws nginx config (#100) --- .github/workflows/deploy.test.yml | 2 +- nginx/nginx.conf | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.test.yml b/.github/workflows/deploy.test.yml index 413a7be4..e45903fd 100644 --- a/.github/workflows/deploy.test.yml +++ b/.github/workflows/deploy.test.yml @@ -35,4 +35,4 @@ jobs: echo "${{ secrets.APPFLOWY_CLOUD_KEY }}" | base64 --decode > ./nginx/ssl/private_key.key - name: Deploy docker-compose - run: sudo docker compose up -d --build --force-recreate + run: sudo docker-compose up -d --build --force-recreate diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 4a95570f..69954fa1 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -6,6 +6,11 @@ events { } http { + map $http_upgrade $connection_upgrade { + default upgrade; + '' close; + } + server { ssl_certificate /etc/nginx/ssl/certificate.crt; ssl_certificate_key /etc/nginx/ssl/private_key.key; @@ -20,7 +25,7 @@ http { # WebSocket location /ws { - proxy_pass http://appflowy_cloud; + proxy_pass http://appflowy_cloud:8000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade";