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

@ -69,7 +69,10 @@ server {
ssl_certificate /etc/letsencrypt/live/inno-js.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/inno-js.ru/privkey.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 /etc/nginx/snippets/ssl-params.conf;

View File

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

View File

@ -12,4 +12,16 @@ location /multystub/ {
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
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;
}