-
Notifications
You must be signed in to change notification settings - Fork 151
/
nginx.conf
39 lines (31 loc) · 1.05 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
# 仅是部分对于项目的配置,其他配置项可自定义
events {
worker_connections 1024;
}
http {
include /etc/nginx/conf.d/*.conf;
server {
listen 443 ssl http2 default_server;
server_name web.0351zhuangxiu.com;
gzip on;
gzip_disable "msie6";
gzip_min_length 1k;
gzip_vary on;
gzip_types text/plain text/css application/json application/x-javascript application/javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
ssl_certificate /etc/nginx/ssl/web.0351zhuangxiu.com/ssl.crt;
ssl_certificate_key /etc/nginx/ssl/web.0351zhuangxiu.com/ssl.key;
location ^~ /tour/ {
root /work/web;
try_files $uri $uri/ /tour/index.html;
}
location ~ .*\.(js|css|png|jpg|jpeg)$ {
root /work/web;
add_header Cache-Control max-age=600;
}
}
server {
listen 80;
server_name web.0351zhuangxiu.com;
rewrite ^(.*) https://$host$1 permanent;
}
}