-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36de78c
commit c2684ec
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
server_name 192.168.1.144; | ||
return 301 https://$server_name$request_uri; | ||
} | ||
|
||
server { | ||
server_name 192.168.1.144; | ||
listen 8001; | ||
return 301 https://$host$request_uri; | ||
} | ||
|
||
upstream websocket { | ||
server 192.168.1.144; | ||
server 192.168.1.145; | ||
server 192.168.1.146; | ||
server 192.168.1.147; | ||
} | ||
|
||
server { | ||
listen 443 ssl; | ||
listen [::]:443 ssl; | ||
server_name 192.168.1.144; | ||
root /usr/share/nginx/html; | ||
ssl_certificate /etc/nginx/ssl/host.cert; | ||
ssl_certificate_key /etc/nginx/ssl/host.key; | ||
|
||
location / { | ||
proxy_buffers 8 32k; | ||
proxy_buffer_size 64k; | ||
proxy_pass http://websocket; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-NginX-Proxy true; | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
proxy_read_timeout 86400s; | ||
proxy_send_timeout 86400s; | ||
} | ||
} |