Skip to content

Commit

Permalink
nginx conf changes for websocket
Browse files Browse the repository at this point in the history
  • Loading branch information
farooqpk committed Sep 19, 2024
1 parent 9f83ff7 commit 9d31ec9
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions nginx/app.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;

server {
listen 80;
server_name talker.fun www.talker.fun;
Expand Down Expand Up @@ -30,13 +36,20 @@ server {
}

location /api {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://chat-backend:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Connection "upgrade";
}

location /socket.io {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_pass http://chat-backend:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}

0 comments on commit 9d31ec9

Please sign in to comment.