Skip to content

Commit

Permalink
feat: nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohaodu committed May 21, 2024
1 parent 61042de commit 51411d9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/web-chat-x-vue/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,27 @@ server {

location ^~/api/ {
proxy_pass http://web-chat-x-express:8099/;
rewrite ^/api/(.*) /$1 break;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}

location ^~/peer/ {
proxy_pass http://web-chat-x-express:8099/peer/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}

location ^~/libp2p/ {
proxy_pass http://web-chat-x-express:8100/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}

# MIME类型设置
Expand All @@ -35,7 +48,7 @@ server {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Connection "update";
try_files $uri $uri/ /index.html;
}

Expand Down

0 comments on commit 51411d9

Please sign in to comment.