Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable websocket communication #3362

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions qiita_pet/nginx_example.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ http {
server localhost:21177;
}

# define variables for the actions that shall be taken for websocket handshake
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}

# listening to 8080 and redirecting to https
server {
listen 8080;
Expand Down Expand Up @@ -56,6 +62,19 @@ http {
alias /Users/username/qiita/qiita_db/support_files/test_data/;
}

# enables communiction through websockets.
# Currently, only endpoints /consumer/, /analysis/selected/socket/, and /study/list/socket/ use websockets
location ~ ^/(consumer|analysis/selected/socket|study/list/socket)/ {
proxy_pass $scheme://mainqiita;
proxy_set_header Host $http_host;
proxy_redirect http:// https://;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-Host $http_host;
}

location / {
proxy_pass $scheme://mainqiita;
proxy_redirect off;
Expand Down
Loading