-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnicornLoadBalancer.conf
More file actions
61 lines (51 loc) · 1.55 KB
/
UnicornLoadBalancer.conf
File metadata and controls
61 lines (51 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
server {
# Listen
listen 80;
listen [::]:80;
server_name myplex.com;
# Redirect
location / {
return 301 https://myplex.com;
}
}
server {
# Listen
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name myplex.com;
# Logs
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
# SSL
ssl_certificate /etc/letsencrypt/live/myplex.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/myplex.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
# Let's Encrypt
location /.well-known/acme-challenge {
auth_basic off;
allow all;
alias /var/www/.letsencrypt;
}
# Timeout
client_body_timeout 240m;
send_timeout 100m;
# Proxy
location / {
# Proxy configuration
proxy_pass http://127.0.0.1:3001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Proxy settings
proxy_redirect off;
proxy_buffering off;
## Websockets support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 36000s;
proxy_send_timeout 36000s;
proxy_connect_timeout 36000s;
}
}