-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
45 lines (38 loc) · 1.26 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
server {
listen 80;
server_name wangbjun.site; #localhost修改为证书绑定的域名
rewrite ^(.*)$ https://$server_name$1 permanent; #http请求强制跳转https
}
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
root /opt/blog;
index index.html index.htm index.nginx-debian.html;
server_name wangbjun.site;
ssl on;
ssl_certificate /opt/blog/site.pem; #替换成证书的文件名
ssl_certificate_key /opt/blog/site.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;
location / {
try_files $uri $uri/ =404;
}
location ~* \.(ico|jpe?g|gif|png|bmp|swf|flv)$ {
expires 30d;
log_not_found off;
access_log off;
}
location /busuanzi/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8542/;
}
location ~* \.(js|css)$ {
expires 7d;
log_not_found off;
access_log off;
}
}