Skip to content

Commit ce53139

Browse files
committed
Attempt to fix collab ws issues
Merged in relevant changes from n1-comm while incorporating nginx
1 parent 3ae3404 commit ce53139

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

nginx/nginx.conf

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ http {
4040
server storage-blob-api:9300;
4141
}
4242

43-
# upstream collab {
44-
# server collab:4000;
45-
# }
43+
upstream collab {
44+
server collab:4000;
45+
}
4646

4747
server {
4848
listen 80;
@@ -74,8 +74,16 @@ http {
7474
proxy_pass http://storage_blob_api/;
7575
}
7676

77-
# location /collab/ {
78-
# proxy_pass http://collab/;
79-
# }
77+
location /collab/ {
78+
proxy_pass http://collab/;
79+
proxy_set_header Host $host;
80+
proxy_set_header X-Real-IP $remote_addr;
81+
proxy_set_header X-Forwarded-Proto $scheme;
82+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
83+
proxy_http_version 1.1;
84+
proxy_set_header Upgrade $http_upgrade;
85+
proxy_set_header Connection "upgrade";
86+
proxy_read_timeout 86400;
87+
}
8088
}
8189
}

peerprep/components/questionpage/Matchmaking.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
import ResettingStopwatch from "../shared/ResettingStopwatch";
1818
import PeerprepDropdown from "../shared/PeerprepDropdown";
1919

20-
const QUERY_INTERVAL_MILLISECONDS = 5000;
20+
const QUERY_INTERVAL_MILLISECONDS = 1000;
2121
const TIMEOUT_MILLISECONDS = 30000;
2222

2323
const getMatchRequestTime = (): string => {

peerprep/next.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {}
2+
const nextConfig = {};
33

44
module.exports = {
55
async rewrites() {
66
return [
77
{
8-
source: '/api/proxy', // client connects to api/proxy
8+
source: "/api/proxy", // client connects to api/proxy
99
// by default we expect NEXT_PUBLIC_COLLAB to be http://collab:4000.
1010
// double check this before using this.
11-
destination: `${process.env.NEXT_PUBLIC_COLLAB}/ws`,
12-
}
13-
]
14-
}
15-
}
11+
destination: `${process.env.NEXT_PUBLIC_NGINX}/${process.env.NEXT_PUBLIC_COLLAB}/ws`,
12+
},
13+
];
14+
},
15+
};

0 commit comments

Comments
 (0)