forked from chowa/ejyy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
api.conf
executable file
·66 lines (57 loc) · 2.21 KB
/
api.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
59
60
61
62
63
64
65
66
server {
listen 80;
server_name api.wuye.webinfra.cloud;
#rewrite ^(.*) https://$server_name$1 permanent;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl ;
server_name api.wuye.webinfra.cloud;
# ssl on;
ssl_certificate /etc/nginx/ssl/api.wuye.webinfra.cloud_bundle.crt;
ssl_certificate_key /etc/nginx/ssl/api.wuye.webinfra.cloud.key;
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;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
add_header Strict-Transport-Security "max-age=31536000";
index index.php index.html index.htm default.php default.htm default.html;
root /usr/share/nginx/ejyy/console-web/dist;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Nginx-Proxy true;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass http://localhost:6688;
}
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
{
return 404;
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
#禁止在证书验证目录放入敏感文件
if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
return 403;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log /dev/null;
access_log /dev/null;
}
location ~ .*\.(js|css)?$
{
expires 12h;
error_log /dev/null;
access_log /dev/null;
}
access_log /var/log/nginx/api.ejyy.chowa.cn.log;
error_log /var/log/nginx/api.ejyy.chowa.cn.error.log;
}