Skip to content

Commit 1c3a473

Browse files
authored
enable websocket communication (#3362)
extend the nginx example configuration file such that communication through WebSockets is automatically enabled
1 parent 426268c commit 1c3a473

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

qiita_pet/nginx_example.conf

+19
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ http {
1313
server localhost:21177;
1414
}
1515

16+
# define variables for the actions that shall be taken for websocket handshake
17+
map $http_upgrade $connection_upgrade {
18+
default upgrade;
19+
'' close;
20+
}
21+
1622
# listening to 8080 and redirecting to https
1723
server {
1824
listen 8080;
@@ -56,6 +62,19 @@ http {
5662
alias /Users/username/qiita/qiita_db/support_files/test_data/;
5763
}
5864

65+
# enables communiction through websockets.
66+
# Currently, only endpoints /consumer/, /analysis/selected/socket/, and /study/list/socket/ use websockets
67+
location ~ ^/(consumer|analysis/selected/socket|study/list/socket)/ {
68+
proxy_pass $scheme://mainqiita;
69+
proxy_set_header Host $http_host;
70+
proxy_redirect http:// https://;
71+
proxy_http_version 1.1;
72+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
73+
proxy_set_header Upgrade $http_upgrade;
74+
proxy_set_header Connection $connection_upgrade;
75+
proxy_set_header X-Forwarded-Host $http_host;
76+
}
77+
5978
location / {
6079
proxy_pass $scheme://mainqiita;
6180
proxy_redirect off;

0 commit comments

Comments
 (0)