-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
48 lines (40 loc) · 1.29 KB
/
nginx.conf
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
# /etc/nginx/sites-avaliable/<your_domain>
# your_domain config
server {
listen [::]:80;
listen 80;
listen [::]:443 ssl;
listen 443 ssl;
server_name <your_domain>;
# body size
client_max_body_size 512M;
# RSA certificate
ssl_certificate /etc/letsencrypt/live/<your_root_domain>/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/<your_root_domain>/privkey.pem; # managed by Certbot
#Redirect non-https traffic to https
if ($scheme != "https") {
return 301 https://$host$request_uri;
}
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://localhost:8080;
}
}
# your root domain config
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
server_name <your_root_domain> www.<your_root_domain>;
index index.html index.htm;
root /data/www;
# RSA certificate
ssl_certificate /etc/letsencrypt/live/<your_root_domain>/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/<your_root_domain>/privkey.pem; # managed by Certbot
# Redirect non-https traffic to https
if ($scheme != "https") {
return 301 https://$host$request_uri;
}
}