-
Notifications
You must be signed in to change notification settings - Fork 0
/
a.knighter.xyz.conf
58 lines (50 loc) · 1.64 KB
/
a.knighter.xyz.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
49
50
51
52
53
54
55
56
57
58
server{
#监听443端口
listen 443;
#对应的域名改成你们自己的域名就可以了
server_name a.knighter.xyz;
ssl on;
#从腾讯云获取到的第一个文件的全路径
ssl_certificate /root/Nginx/a.knighter.xyz/ssl.crt;
#从腾讯云获取到的第二个文件的全路径
ssl_certificate_key /root/Nginx/a.knighter.xyz/ssl.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
#这是我的主页访问地址,因为使用的是静态的html网页,所以直接使用location就可以完成了。
location / {
#文件夹
root /usr/share/nginx/html;
#主页文件
index index.html index.php;
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.(jpg|png|jpeg|gif)$ {
expires 30d;
root /usr/share/nginx/html;
}
location ~ \.(js|css)$ {
expires 2h;
root /usr/share/nginx/html;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_log /home/wwwlogs/admin_error.log;
}
server{
listen 80;
server_name a.knighter.xyz;
rewrite ^/(.*)$ https://a.knighter.xyz:443/$1 permanent;
}