-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault-https.conf
More file actions
57 lines (48 loc) · 1.42 KB
/
default-https.conf
File metadata and controls
57 lines (48 loc) · 1.42 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
server {
listen 80;
server_name BBB;
root AAA;
access_log /var/log/nginx/BBB.http.log;
# Certbot 验证路径例外,不重定向
location /.well-known/ {
root AAA;
}
# 其他所有请求重定向到 HTTPS
location / {
return 301 https://$server_name$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name BBB;
access_log /var/log/nginx/BBB.https.log;
root AAA;
ssl_certificate /etc/letsencrypt/live/BBB/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/BBB/privkey.pem;
# Certbot renew 验证路径
location /.well-known/ {
root AAA;
}
# resolver 8.8.8.8 valid=30s;
# set $addr "http://127.0.0.1:8080";
# # 所有请求都代理到后端
# location / {
# proxy_pass $addr;
# 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_set_header X-Forwarded-Proto $scheme;
# # WebSocket 支持
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# # 超时设置
# proxy_connect_timeout 60s;
# proxy_send_timeout 300s;
# proxy_read_timeout 300s;
# }
location = / {
index index.html;
}
}