websocket

This commit is contained in:
Primakov Alexandr Alexandrovich 2022-02-09 22:47:11 +03:00
parent a62fd823bf
commit 685c37a0ed
3 changed files with 27 additions and 2 deletions

View File

@ -70,6 +70,9 @@ server {
ssl_certificate_key /etc/letsencrypt/live/inno-js.ru/privkey.pem; ssl_certificate_key /etc/letsencrypt/live/inno-js.ru/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/inno-js.ru/chain.pem; ssl_trusted_certificate /etc/letsencrypt/live/inno-js.ru/chain.pem;
ssl_prefer_server_ciphers on;
ssl_verify_client off;
include "parts/api-multystub.conf"; include "parts/api-multystub.conf";
include /etc/nginx/snippets/ssl-params.conf; include /etc/nginx/snippets/ssl-params.conf;

View File

@ -6,6 +6,11 @@ events {
} }
http { http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
resolver 127.0.0.1; resolver 127.0.0.1;
include mime.types; include mime.types;
default_type application/octet-stream; default_type application/octet-stream;
@ -19,6 +24,11 @@ http {
server 212.193.59.173:8033; server 212.193.59.173:8033;
} }
upstream websocket {
server 212.193.59.173:8033;
keepalive 1000;
}
upstream multystub { upstream multystub {
server 212.193.59.173:8043; server 212.193.59.173:8043;
} }

View File

@ -13,3 +13,15 @@ location /multystub/ {
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
proxy_pass http://multystub/; proxy_pass http://multystub/;
} }
location /websocket/ {
proxy_http_version 1.1;
proxy_pass http://websocket/api/socket.io/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 3600s;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}