step-by-step: Nginx-stream
|
1 2 |
apt install -y nginx libnginx-mod-stream mkdir -p /etc/nginx/stream-conf.d |
|
1 |
nano /etc/nginx/stream-conf.d/mtproto.conf |
Вставь:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
upstream mtproto_backend { server 1.1.1.101:443 weight=3 max_fails=3 fail_timeout=10s; server 1.1.1.102:443 weight=1 max_fails=3 fail_timeout=10s; } server { listen 443; proxy_pass mtproto_backend; proxy_connect_timeout 5s; proxy_timeout 1h; proxy_socket_keepalive on; } |
|
1 |
nano /etc/nginx/nginx.conf |
В самый конец файла добавь блок вне http {}, то есть после закрывающей скобки http:
|
1 2 3 |
stream { include /etc/nginx/stream-conf.d/*.conf; } |
|
1 2 3 |
nginx -t systemctl reload nginx systemctl enable --now nginx<br> |
|
1 2 |
ufw allow 443/tcp ufw reload |