diff --git a/qiita_pet/nginx_example.conf b/qiita_pet/nginx_example.conf index 400963dc7..36c3d7809 100644 --- a/qiita_pet/nginx_example.conf +++ b/qiita_pet/nginx_example.conf @@ -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; @@ -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;