-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx.default.conf
38 lines (33 loc) · 1.32 KB
/
nginx.default.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
# 以下属性中以ssl开头的属性代表与证书配置有关,其他属性请根据自己的需要进行配置。
server {
listen 443 ssl http2; #https且开启http2
server_name www.whitealbum.cc;
ssl_certificate /etc/nginx/cert/2485343_www.whitealbum.cc.pem; #将domain name.pem替换成您证书的文件名。
ssl_certificate_key /etc/nginx/cert/2485343_www.whitealbum.cc.key; #将domain name.key替换成您证书的密钥文件名。
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #使用此加密套件。
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #使用该协议进行配置。
ssl_prefer_server_ciphers on;
client_max_body_size 10M;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /search.php {
proxy_pass https://saucenao.com; # 转发地址
proxy_ssl_server_name on;
}
location /traceMoe/ {
proxy_pass https://trace.moe/api/; # 转发地址
proxy_ssl_server_name on;
}
}
# http重定向
server {
if ($host = www.whitealbum.cc) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name www.whitealbum.cc;
return 404; # managed by Certbot
}