├── .gitignore
├── LICENSE
├── README.md
├── bin
└── split-log
├── conf
├── alafe.org
│ └── alafe.org.conf
├── apijs
│ ├── apijs.net.conf
│ └── apijs.org.conf
├── apmjs.org
│ └── apmjs.org.conf
├── common
│ └── redirect.conf
├── inc
│ ├── favicon.conf
│ ├── favicon.jiandansousuo.com.conf
│ ├── robots.conf
│ ├── robots.disallow.conf
│ ├── ssl.alafe.org.conf
│ ├── ssl.apijs.org.conf
│ ├── ssl.apmjs.org.conf
│ ├── ssl.conf
│ ├── ssl.jiandansousuo.com.conf
│ ├── ssl.stcjs.org.conf
│ └── ssl.xuexb.com.conf
├── jiandansousuo
│ ├── demo.jiandansousuo.com.conf
│ ├── jiandansousuo.com.conf
│ ├── mip.jiandansousuo.com.conf
│ └── redirect.conf
├── mime.types
├── nginx.conf
├── stcjs.org
│ └── stcjs.org.conf
└── xuexb
│ ├── 8003.xuexb.com.conf
│ ├── admin.static.xuexb.com.conf
│ ├── admin.xuexb.com.conf
│ ├── amp.xuexb.com.conf
│ ├── api.xuexb.com.conf
│ ├── cache.xuexb.com.conf
│ ├── ci.xuexb.com.conf
│ ├── echo.xuexb.com.conf
│ ├── github.xuexb.com.conf
│ ├── log.xuexb.com.conf
│ ├── login.mip.xuexb.com.conf
│ ├── mip.xuexb.com.conf
│ ├── npm.registry.xuexb.com.conf
│ ├── parse.mip.xuexb.com.conf
│ ├── proxy.xuexb.com.conf
│ ├── static.xuexb.com.conf
│ ├── status.xuexb.com.conf
│ ├── v.xuexb.com
│ ├── xuexb.cn.conf
│ ├── xuexb.com.conf
│ └── xzh.mip.xuexb.com.conf
├── html
├── disallow
│ └── robots.txt
├── favicon.ico
├── jiandansousuo.com
│ └── favicon.ico
└── robots.txt
└── ssl
└── .gitkeep
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 |
6 | # Runtime data
7 | pids
8 | *.pid
9 | *.seed
10 |
11 | # Directory for instrumented libs generated by jscoverage/JSCover
12 | lib-cov
13 |
14 | # Coverage directory used by tools like istanbul
15 | coverage
16 |
17 | # nyc test coverage
18 | .nyc_output
19 |
20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21 | .grunt
22 |
23 | # node-waf configuration
24 | .lock-wscript
25 |
26 | # Compiled binary addons (http://nodejs.org/api/addons.html)
27 | build/Release
28 |
29 | # Dependency directories
30 | node_modules
31 | jspm_packages
32 |
33 | # Optional npm cache directory
34 | .npm
35 |
36 | # Optional REPL history
37 | .node_repl_history
38 |
39 | /ssl/*
40 | !/ssl/.gitkeep
41 |
42 | /conf/*.default
43 | *.csr
44 | *.key
45 | *.crt
46 | *.csr
47 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 前端小武
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # nginx-conf
2 |
3 | > 注意,本仓库只是我的站点一些配置,[github.com/xuexb/learn-nginx](https://github.com/xuexb/learn-nginx) 这里有更多配置说明~
4 |
5 | - 使用 [acme.sh](https://github.com/Neilpang/acme.sh) 生成 [letsencrypt](https://letsencrypt.org/) 泛域名证书
6 | - 使用 `crontab` + `bin/split-log` 定时切割nginx日志
7 | - 统一管理 `/favicon.ico` (优先使用站点目录内文件,如果不存在则使用统一的)
8 | - 统一管理`/robots.txt`(优先使用站点目录内文件,如果不存在则使用统一的)
9 |
10 | ## 目录结构
11 |
12 | ```
13 | # 配置文件根目录
14 | /home/xiaowu/local/nginx-conf/
15 |
16 | # 可执行文件
17 | ./bin/
18 |
19 | # nginx配置
20 | ./conf/
21 |
22 | # 扩展文件,包括通用 favicon.ico 、通用 robots.txt 、SSL 能用配置
23 | ./conf/inc/
24 |
25 | # 站点配置
26 | ./conf/主域名/
27 |
28 | # 公用静态文件
29 | ./html/
30 |
31 | # SSL 证书,acme 生成后需要复制到该文件夹
32 | ./ssl/
33 |
34 | # 日志源文件
35 | /var/log/nginx/xuexb.com/last/{access,rror}.{子域名}.log
36 |
37 | # 日志切割文件文件
38 | /var/log/nginx/xuexb.com/back/{Y-m-d}/{access,rror}.{子域名}.log
39 | ```
40 |
41 | ## 命令
42 |
43 | ```bash
44 | # 生成证书
45 | # 博客相关
46 | acme.sh --issue --dns dns_ali -d xuexb.com -d *.xuexb.com -d *.registry.xuexb.com -d *.cdn.xuexb.com -d *.api.xuexb.com -d *.static.xuexb.com -d xuexb.cn -d www.xuexb.cn -d *.mip.xuexb.com *.amp.xuexb.com --log
47 |
48 | # apijs 相关
49 | acme.sh --issue --dns dns_ali -d apijs.org -d *.apijs.org -d apijs.net -d *.apijs.net --log
50 |
51 | # alafe 相关
52 | acme.sh --issue --dns dns_ali -d alafe.org -d *.alafe.org --log
53 |
54 | # jiandansousuo 相关
55 | acme.sh --issue \
56 | --dns dns_ali \
57 | -d jiandansousuo.com \
58 | -d *.jiandansousuo.com \
59 | -d *.api.jiandansousuo.com \
60 | -d *.proxy.jiandansousuo.com \
61 | -d *.static.jiandansousuo.com \
62 | -d *.cdn.jiandansousuo.com \
63 | -d jiandansousuo.cn \
64 | -d *.jiandansousuo.cn \
65 | -d jiandansousuo.org \
66 | -d *.jiandansousuo.org \
67 | --log
68 |
69 | # 安装博客证书到配置目录
70 | acme.sh --install-cert -d xuexb.com \
71 | --key-file /home/xiaowu/local/nginx-conf/ssl/xuexb.com.key \
72 | --fullchain-file /home/xiaowu/local/nginx-conf/ssl/xuexb.com.fullchain.cer \
73 | --reloadcmd "/home/xiaowu/local/nginx-1.11.2/sbin/nginx -s stop && /home/xiaowu/local/nginx-1.11.2/sbin/nginx"
74 |
75 | # 安装 apijs 证书到配置目录
76 | acme.sh --install-cert -d apijs.org \
77 | --key-file /home/xiaowu/local/nginx-conf/ssl/apijs.org.key \
78 | --fullchain-file /home/xiaowu/local/nginx-conf/ssl/apijs.org.fullchain.cer \
79 | --reloadcmd "/home/xiaowu/local/nginx-1.11.2/sbin/nginx -s stop && /home/xiaowu/local/nginx-1.11.2/sbin/nginx"
80 |
81 | # 安装 alafe 证书到配置目录
82 | acme.sh --install-cert -d alafe.org \
83 | --key-file /home/xiaowu/local/nginx-conf/ssl/alafe.org.key \
84 | --fullchain-file /home/xiaowu/local/nginx-conf/ssl/alafe.org.fullchain.cer \
85 | --reloadcmd "/home/xiaowu/local/nginx-1.11.2/sbin/nginx -s stop && /home/xiaowu/local/nginx-1.11.2/sbin/nginx"
86 |
87 | # 安装 jiandansousuo 证书到配置目录
88 | acme.sh --install-cert -d jiandansousuo.com \
89 | --key-file /home/xiaowu/local/nginx-conf/ssl/jiandansousuo.com.key \
90 | --fullchain-file /home/xiaowu/local/nginx-conf/ssl/jiandansousuo.com.fullchain.cer \
91 | --reloadcmd "/home/xiaowu/local/nginx-1.11.2/sbin/nginx -s stop && /home/xiaowu/local/nginx-1.11.2/sbin/nginx"
92 |
93 | # 添加定时任务
94 | # 先卸载当前用户的
95 | acme.sh --uninstall-cronjob
96 | # su root ,切换到 root 下,因为刷新 Nginx 的命令需要 root
97 | acme.sh --install-cronjob
98 |
99 | # 切换到 root 用户下添加定时任务
100 | crontab -e
101 | # 插入一条定时任务,定时23:50开始分割,后面是把错误和信息输出到指定文件,方便调试
102 | 50 23 * * * sh /home/xiaowu/local/nginx-conf/bin/split-log >> /var/log/nginx/crontab.log 2>&1
103 | ```
104 |
--------------------------------------------------------------------------------
/bin/split-log:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | sourceDir='/var/log/nginx/xuexb.com/last'
4 | backDir='/var/log/nginx/xuexb.com/back'
5 |
6 | echo "start: $(date)"
7 | echo "开始移动日志: $(date +%Y%m%d)"
8 | ls $sourceDir | while read filename
9 | do
10 | mkdir -p "$backDir/$(date +%Y%m%d)/"
11 | mv "$sourceDir/$filename" "$backDir/$(date +%Y%m%d)/"
12 | echo "$sourceDir/$filename => $backDir/$(date +%Y%m%d)/$filename"
13 | done
14 | echo "移动日志结束: $(date +%Y%m%d)"
15 | echo "\n\n"
16 |
17 | # 刷新nginx
18 | kill -USR1 `cat /var/run/nginx.pid`
--------------------------------------------------------------------------------
/conf/alafe.org/alafe.org.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name alafe.org www.alafe.org;
3 |
4 | root /home/xiaowu/wwwroot/alafe.org;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.alafe.org.conf;
8 |
9 | if ( $host != 'alafe.org' ){
10 | rewrite (.*) https://alafe.org permanent;
11 | }
12 |
13 | # 加载公用robots.txt
14 | include inc/robots.conf;
15 |
16 | # 加载公用favicon
17 | include inc/favicon.conf;
18 |
19 | error_log /var/log/nginx/alafe.org/last/error.api.log warn;
20 | access_log /var/log/nginx/alafe.org/last/access.api.log main;
21 | }
--------------------------------------------------------------------------------
/conf/apijs/apijs.net.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name apijs.net *.apijs.net;
3 |
4 | # 加载 SSL 公用配置
5 | include inc/ssl.apijs.org.conf;
6 |
7 | # 加载公用robots.txt
8 | include inc/robots.conf;
9 |
10 | # 加载公用favicon
11 | include inc/favicon.conf;
12 |
13 | access_log off;
14 | error_log off;
15 |
16 | rewrite ^(.*) https://apijs.org$1 permanent;
17 | }
--------------------------------------------------------------------------------
/conf/apijs/apijs.org.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name www.apijs.org apijs.org;
3 |
4 | root /home/xiaowu/wwwroot/apijs.org;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.apijs.org.conf;
8 |
9 | if ( $host != 'apijs.org' ){
10 | rewrite (.*) https://apijs.org permanent;
11 | }
12 |
13 | # 加载公用robots.txt
14 | include inc/robots.conf;
15 |
16 | # 加载公用favicon
17 | include inc/favicon.conf;
18 |
19 | error_log /var/log/nginx/apijs.org/last/error.log warn;
20 | access_log /var/log/nginx/apijs.org/last/access.log main;
21 | }
--------------------------------------------------------------------------------
/conf/apmjs.org/apmjs.org.conf:
--------------------------------------------------------------------------------
1 | # server {
2 | # server_name apmjs.org www.apmjs.org;
3 |
4 | # root /home/xiaowu/wwwroot/apmjs.org;
5 |
6 | # # 加载 SSL 公用配置
7 | # include inc/ssl.apmjs.org.conf;
8 |
9 | # if ( $host != 'apmjs.org' ){
10 | # rewrite (.*) https://apmjs.org permanent;
11 | # }
12 |
13 | # # 加载公用robots.txt
14 | # include inc/robots.conf;
15 |
16 | # # 加载公用favicon
17 | # include inc/favicon.conf;
18 |
19 | # error_log /var/log/nginx/apmjs.org/last/error.api.log warn;
20 | # access_log /var/log/nginx/apmjs.org/last/access.api.log main;
21 | # }
--------------------------------------------------------------------------------
/conf/common/redirect.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 80;
3 | server_name ~^((.+)\.)?(xuexb|jiandansousuo|alafe|apijs|stcjs|apmjs)\.(.+)$;
4 |
5 | access_log off;
6 | error_log off;
7 |
8 | location / {
9 | add_header strict-transport-security 'max-age=31536000; includeSubDomains; preload';
10 | rewrite ^(.*) https://$host permanent;
11 | }
12 | }
--------------------------------------------------------------------------------
/conf/inc/favicon.conf:
--------------------------------------------------------------------------------
1 | location = /favicon.ico {
2 | # 如果文件不存在, 代理到公共里
3 | if ( !-f $request_filename ){
4 | root /home/xiaowu/local/nginx-conf/html;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/conf/inc/favicon.jiandansousuo.com.conf:
--------------------------------------------------------------------------------
1 | location = /favicon.ico {
2 | # 如果文件不存在, 代理到公共里
3 | if ( !-f $request_filename ){
4 | root /home/xiaowu/local/nginx-conf/html/jiandansousuo.com;
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/conf/inc/robots.conf:
--------------------------------------------------------------------------------
1 | location = /robots.txt {
2 | # 如果文件不存在, 代理到公共里
3 | if ( !-f $request_filename ){
4 | root /home/xiaowu/local/nginx-conf/html;
5 | }
6 | }
--------------------------------------------------------------------------------
/conf/inc/robots.disallow.conf:
--------------------------------------------------------------------------------
1 | location = /robots.txt {
2 | root /home/xiaowu/local/nginx-conf/html/disallow;
3 | }
--------------------------------------------------------------------------------
/conf/inc/ssl.alafe.org.conf:
--------------------------------------------------------------------------------
1 | include inc/ssl.conf;
2 | ssl_certificate /home/xiaowu/local/nginx-conf/ssl/alafe.org.fullchain.cer;
3 | ssl_certificate_key /home/xiaowu/local/nginx-conf/ssl/alafe.org.key;
--------------------------------------------------------------------------------
/conf/inc/ssl.apijs.org.conf:
--------------------------------------------------------------------------------
1 | include inc/ssl.conf;
2 | ssl_certificate /home/xiaowu/local/nginx-conf/ssl/apijs.org.fullchain.cer;
3 | ssl_certificate_key /home/xiaowu/local/nginx-conf/ssl/apijs.org.key;
--------------------------------------------------------------------------------
/conf/inc/ssl.apmjs.org.conf:
--------------------------------------------------------------------------------
1 | include inc/ssl.conf;
2 | ssl_certificate /home/xiaowu/local/nginx-conf/ssl/apmjs.org.fullchain.cer;
3 | ssl_certificate_key /home/xiaowu/local/nginx-conf/ssl/apmjs.org.key;
--------------------------------------------------------------------------------
/conf/inc/ssl.conf:
--------------------------------------------------------------------------------
1 | listen 443 ssl http2;
2 |
3 | ## verify chain of trust of OCSP response using Root CA and Intermediate certs
4 | add_header strict-transport-security 'max-age=31536000; includeSubDomains; preload';
5 |
6 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
7 | ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4:!DH:!DHE;
8 | ssl_prefer_server_ciphers on;
9 | ssl_session_cache shared:SSL:10m;
10 | ssl_session_timeout 1d;
11 | ssl_session_tickets off;
--------------------------------------------------------------------------------
/conf/inc/ssl.jiandansousuo.com.conf:
--------------------------------------------------------------------------------
1 | include inc/ssl.conf;
2 | ssl_certificate /home/xiaowu/local/nginx-conf/ssl/jiandansousuo.com.fullchain.cer;
3 | ssl_certificate_key /home/xiaowu/local/nginx-conf/ssl/jiandansousuo.com.key;
--------------------------------------------------------------------------------
/conf/inc/ssl.stcjs.org.conf:
--------------------------------------------------------------------------------
1 | include inc/ssl.conf;
2 | ssl_certificate /home/xiaowu/local/nginx-conf/ssl/stcjs.org.fullchain.cer;
3 | ssl_certificate_key /home/xiaowu/local/nginx-conf/ssl/stcjs.org.key;
--------------------------------------------------------------------------------
/conf/inc/ssl.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | include inc/ssl.conf;
2 | ssl_certificate /home/xiaowu/local/nginx-conf/ssl/xuexb.com.fullchain.cer;
3 | ssl_certificate_key /home/xiaowu/local/nginx-conf/ssl/xuexb.com.key;
--------------------------------------------------------------------------------
/conf/jiandansousuo/demo.jiandansousuo.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name demo.jiandansousuo.com;
3 |
4 | root /home/xiaowu/wwwroot/demo.jiandansousuo.com;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.jiandansousuo.com.conf;
8 |
9 | # 加载公用robots.txt
10 | include inc/robots.conf;
11 |
12 | # 加载公用favicon
13 | include inc/favicon.jiandansousuo.com.conf;
14 |
15 | error_log /var/log/nginx/jiandansousuo.com/last/error.demo.log warn;
16 | access_log /var/log/nginx/jiandansousuo.com/last/access.demo.log nginx_cache_json;
17 |
18 | # 使用location来匹配以字体文件
19 | location ~* \.(eot|otf|ttf|woff|svg)$ {
20 | add_header Access-Control-Allow-Origin *;
21 | }
22 | }
--------------------------------------------------------------------------------
/conf/jiandansousuo/jiandansousuo.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name jiandansousuo.com www.jiandansousuo.com;
3 |
4 | root /home/xiaowu/wwwroot/jiandansousuo.com;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.jiandansousuo.com.conf;
8 |
9 | # 加载公用robots.txt
10 | include inc/robots.conf;
11 |
12 | # 加载公用favicon
13 | include inc/favicon.jiandansousuo.com.conf;
14 |
15 | if ( $host != 'jiandansousuo.com' ){
16 | rewrite (.*) https://jiandansousuo.com permanent;
17 | }
18 |
19 | error_log /var/log/nginx/jiandansousuo.com/last/error.log warn;
20 | access_log /var/log/nginx/jiandansousuo.com/last/access.log nginx_cache_json;
21 |
22 | error_page 404 500 =404 /404.html;
23 |
24 | # 使用location来匹配以字体文件
25 | location ~* \.(eot|otf|ttf|woff|svg)$ {
26 | add_header Access-Control-Allow-Origin *;
27 | }
28 | }
--------------------------------------------------------------------------------
/conf/jiandansousuo/mip.jiandansousuo.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name mip.jiandansousuo.com;
3 |
4 | root /home/xiaowu/wwwroot/mip.jiandansousuo.com;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.jiandansousuo.com.conf;
8 |
9 | # 加载公用robots.txt
10 | include inc/robots.conf;
11 |
12 | # 加载公用favicon
13 | include inc/favicon.jiandansousuo.com.conf;
14 |
15 | error_log /var/log/nginx/jiandansousuo.com/last/error.mip.log warn;
16 | access_log /var/log/nginx/jiandansousuo.com/last/access.mip.log nginx_cache_json;
17 |
18 | error_page 404 500 =404 /404.html;
19 |
20 | # 使用location来匹配以字体文件
21 | location ~* \.(eot|otf|ttf|woff|svg)$ {
22 | add_header Access-Control-Allow-Origin *;
23 | }
24 | }
--------------------------------------------------------------------------------
/conf/jiandansousuo/redirect.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name ~^((.+)\.)?(jiandansousuo)\.(.+)$;
3 |
4 | # 加载 SSL 公用配置
5 | include inc/ssl.jiandansousuo.com.conf;
6 |
7 | access_log off;
8 | error_log off;
9 |
10 | rewrite ^(.*) https://jiandansousuo.com$1 permanent;
11 | }
--------------------------------------------------------------------------------
/conf/mime.types:
--------------------------------------------------------------------------------
1 | types {
2 | text/html html htm shtml;
3 | text/css css;
4 | text/xml xml;
5 | image/gif gif;
6 | image/jpeg jpeg jpg;
7 | application/javascript js;
8 | application/atom+xml atom;
9 | application/rss+xml rss;
10 |
11 | text/mathml mml;
12 | text/plain txt;
13 | text/vnd.sun.j2me.app-descriptor jad;
14 | text/vnd.wap.wml wml;
15 | text/x-component htc;
16 |
17 | image/png png;
18 | image/tiff tif tiff;
19 | image/vnd.wap.wbmp wbmp;
20 | image/x-icon ico;
21 | image/x-jng jng;
22 | image/x-ms-bmp bmp;
23 | image/svg+xml svg svgz;
24 | image/webp webp;
25 |
26 | application/font-woff woff;
27 | application/java-archive jar war ear;
28 | application/json json;
29 | application/mac-binhex40 hqx;
30 | application/msword doc;
31 | application/pdf pdf;
32 | application/postscript ps eps ai;
33 | application/rtf rtf;
34 | application/vnd.apple.mpegurl m3u8;
35 | application/vnd.ms-excel xls;
36 | application/vnd.ms-fontobject eot;
37 | application/vnd.ms-powerpoint ppt;
38 | application/vnd.wap.wmlc wmlc;
39 | application/vnd.google-earth.kml+xml kml;
40 | application/vnd.google-earth.kmz kmz;
41 | application/x-7z-compressed 7z;
42 | application/x-cocoa cco;
43 | application/x-java-archive-diff jardiff;
44 | application/x-java-jnlp-file jnlp;
45 | application/x-makeself run;
46 | application/x-perl pl pm;
47 | application/x-pilot prc pdb;
48 | application/x-rar-compressed rar;
49 | application/x-redhat-package-manager rpm;
50 | application/x-sea sea;
51 | application/x-shockwave-flash swf;
52 | application/x-stuffit sit;
53 | application/x-tcl tcl tk;
54 | application/x-x509-ca-cert der pem crt;
55 | application/x-xpinstall xpi;
56 | application/xhtml+xml xhtml;
57 | application/xspf+xml xspf;
58 | application/zip zip;
59 |
60 | application/octet-stream bin exe dll;
61 | application/octet-stream deb;
62 | application/octet-stream dmg;
63 | application/octet-stream iso img;
64 | application/octet-stream msi msp msm;
65 |
66 | application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
67 | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
68 | application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
69 |
70 | audio/midi mid midi kar;
71 | audio/mpeg mp3;
72 | audio/ogg ogg;
73 | audio/x-m4a m4a;
74 | audio/x-realaudio ra;
75 |
76 | video/3gpp 3gpp 3gp;
77 | video/mp2t ts;
78 | video/mp4 mp4;
79 | video/mpeg mpeg mpg;
80 | video/quicktime mov;
81 | video/webm webm;
82 | video/x-flv flv;
83 | video/x-m4v m4v;
84 | video/x-mng mng;
85 | video/x-ms-asf asx asf;
86 | video/x-ms-wmv wmv;
87 | video/x-msvideo avi;
88 | }
--------------------------------------------------------------------------------
/conf/nginx.conf:
--------------------------------------------------------------------------------
1 | # 进程用户
2 | user xiaowu;
3 | worker_processes 1;
4 |
5 | error_log /var/log/nginx/xuexb.com/last/error.default.log warn;
6 | pid /var/run/nginx.pid;
7 |
8 |
9 | events {
10 | worker_connections 1024;
11 | }
12 |
13 |
14 | http {
15 | include mime.types;
16 | default_type application/octet-stream;
17 |
18 | log_format main '$remote_addr - [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" - $http_x_forwarded_for';
19 |
20 | log_format nginx_cache_json '{"remote_addr":"$remote_addr","time_local":"$time_local","request_method":"$request_method","request_uri":"$request_uri","status":"$status","http_referer":"$http_referer","http_user_agent":"$http_user_agent","cache_status":"$upstream_cache_status","x_forwarded_for":"$http_x_forwarded_for"}';
21 |
22 | # 默认编码
23 | charset utf-8;
24 |
25 | # 默认日志
26 | access_log /var/log/nginx/xuexb.com/last/access.default.log main;
27 |
28 | open_log_file_cache max=1000 inactive=60s;
29 |
30 | sendfile on;
31 | #tcp_nopush on;
32 |
33 | keepalive_timeout 65;
34 |
35 | gzip on;
36 | gzip_vary on;
37 |
38 | gzip_comp_level 6;
39 | gzip_buffers 16 8k;
40 |
41 | gzip_min_length 1000;
42 | gzip_proxied any;
43 | gzip_disable "msie6";
44 |
45 | gzip_http_version 1.0;
46 |
47 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
48 |
49 | server_tokens off;
50 |
51 | server {
52 | listen 80 default;
53 | return 403;
54 | }
55 |
56 | # 代理配置
57 | proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=nginx_cache:50m inactive=30d max_size=1g;
58 | proxy_temp_path /var/cache/nginx/temp;
59 | proxy_cache_key $host$uri$is_args$args;
60 |
61 | include common/*.conf;
62 | include xuexb/*.conf;
63 | include apijs/*.conf;
64 | include apmjs.org/*.conf;
65 | include alafe.org/*.conf;
66 | include stcjs.org/*.conf;
67 | include jiandansousuo/*.conf;
68 | }
69 |
--------------------------------------------------------------------------------
/conf/stcjs.org/stcjs.org.conf:
--------------------------------------------------------------------------------
1 | # server {
2 | # server_name stcjs.org www.stcjs.org;
3 |
4 | # root /home/xiaowu/wwwroot/stcjs.org;
5 |
6 | # # 加载 SSL 公用配置
7 | # include inc/ssl.stcjs.org.conf;
8 |
9 | # if ( $host != 'stcjs.org' ){
10 | # rewrite (.*) https://stcjs.org permanent;
11 | # }
12 |
13 | # # 加载公用robots.txt
14 | # include inc/robots.conf;
15 |
16 | # # 加载公用favicon
17 | # include inc/favicon.conf;
18 |
19 | # error_log /var/log/nginx/stcjs.org/last/error.api.log warn;
20 | # access_log /var/log/nginx/stcjs.org/last/access.api.log main;
21 | # }
--------------------------------------------------------------------------------
/conf/xuexb/8003.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name 127.0.0.1;
3 | listen 8003;
4 |
5 | root /home/xiaowu/github/blog/www;
6 |
7 | index index.js index.html index.htm;
8 |
9 | etag off;
10 | gzip off;
11 |
12 | if ( -f $request_filename/index.html ){
13 | rewrite (.*) $1/index.html break;
14 | }
15 |
16 | if ( !-f $request_filename ){
17 | rewrite (.*) /index.js;
18 | }
19 |
20 | location = /index.js {
21 | proxy_http_version 1.1;
22 | proxy_set_header Connection "";
23 | proxy_set_header X-Real-IP $remote_addr;
24 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25 | proxy_set_header Host $http_host;
26 | proxy_set_header X-NginX-Proxy true;
27 | proxy_pass http://127.0.0.1:8360$request_uri;
28 | proxy_redirect off;
29 | }
30 |
31 | access_log off;
32 | error_log off;
33 | }
--------------------------------------------------------------------------------
/conf/xuexb/admin.static.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name admin.static.xuexb.com;
3 |
4 | root /home/xiaowu/wwwroot/admin.static.xuexb.com/www;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.xuexb.com.conf;
8 |
9 | # 加载公用favicon
10 | include inc/favicon.conf;
11 |
12 | # 禁止抓取
13 | include inc/robots.disallow.conf;
14 |
15 | error_log /var/log/nginx/xuexb.com/last/error.admin.static.log warn;
16 | access_log /var/log/nginx/xuexb.com/last/access.admin.static.log main;
17 |
18 | location / {
19 | if ( !-f $request_filename ){
20 | rewrite (.*) /server.js last;
21 | }
22 | }
23 |
24 | # 代理一个假文件
25 | location = /server.js {
26 | proxy_http_version 1.1;
27 | proxy_set_header X-Real-IP $remote_addr;
28 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
29 | proxy_set_header Host $http_host;
30 | proxy_set_header X-NginX-Proxy true;
31 | proxy_set_header Upgrade $http_upgrade;
32 | proxy_set_header Connection "upgrade";
33 | proxy_pass http://127.0.0.1:8021$request_uri;
34 | proxy_redirect off;
35 | }
36 | }
--------------------------------------------------------------------------------
/conf/xuexb/admin.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name admin.xuexb.com;
3 |
4 | root /home/xiaowu/github/blog/www;
5 |
6 | index index.html index.htm;
7 |
8 | # 加载 SSL 公用配置
9 | include inc/ssl.xuexb.com.conf;
10 |
11 | # 加载公用favicon
12 | include inc/favicon.conf;
13 |
14 | # 禁止抓取
15 | include inc/robots.disallow.conf;
16 |
17 | error_log /var/log/nginx/xuexb.com/last/error.admin.log warn;
18 | access_log /var/log/nginx/xuexb.com/last/access.admin.log main;
19 |
20 | location ~* ^/[^\/]+\.js$ {
21 | return 403;
22 | }
23 |
24 | # 默认不缓存, 后续再看
25 | expires -1;
26 | add_header Cache-Control "no-cache";
27 | add_header Pragma no-cache;
28 |
29 | location / {
30 | # 如果文件不存在认识是后端, 代理到node
31 | if ( !-f $request_filename ){
32 | rewrite (.*) /proxy_node;
33 | }
34 | }
35 |
36 | location ^~ /post/ {
37 | rewrite /(.+) https://xuexb.com/$1.html permanent;
38 | }
39 |
40 | location = /proxy_node {
41 | proxy_ignore_headers Set-Cookie;
42 | proxy_hide_header X-Powered-By;
43 | proxy_hide_header vary;
44 |
45 | proxy_set_header Connection "";
46 | proxy_set_header X-Real-IP $remote_addr;
47 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
48 | proxy_set_header Host $http_host;
49 | proxy_set_header X-NginX-Proxy true;
50 | proxy_pass http://127.0.0.1:8360$request_uri;
51 | proxy_redirect off;
52 | }
53 | }
--------------------------------------------------------------------------------
/conf/xuexb/amp.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name amp.xuexb.com;
3 |
4 | root /home/xiaowu/github/blog/www;
5 |
6 | index index.html index.htm;
7 |
8 | # 加载 SSL 公用配置
9 | include inc/ssl.xuexb.com.conf;
10 |
11 | location = /robots.txt {
12 | root /home/xiaowu/github/blog/www/amp;
13 | }
14 |
15 | # 加载公用favicon
16 | include inc/favicon.conf;
17 |
18 | error_log /var/log/nginx/xuexb.com/last/error.amp.log warn;
19 | access_log /var/log/nginx/xuexb.com/last/access.amp.log main;
20 |
21 | location ~* ^/[^\/]+\.js$ {
22 | return 403;
23 | }
24 |
25 | # 适配新路由
26 | rewrite ^/html\/(.*)\.html https://amp.xuexb.com/post/$1.html permanent;
27 | # 重写关于我
28 | rewrite ^/about/?$ https://amp.xuexb.com/post/xiaowu.html permanent;
29 |
30 | # 使用location来匹配以字体文件
31 | location ~* \.(eot|otf|ttf|woff|svg)$ {
32 | add_header Access-Control-Allow-Origin *;
33 | }
34 |
35 | # 如果文件不存在认为是后端, 代理到node
36 | if ( !-f $request_filename ){
37 | rewrite (.*) /proxy_node;
38 | }
39 |
40 | location = /proxy_node {
41 | proxy_ignore_headers Set-Cookie;
42 | proxy_hide_header X-Powered-By;
43 | proxy_hide_header vary;
44 |
45 | proxy_set_header Connection "";
46 | proxy_set_header X-Real-IP $remote_addr;
47 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
48 | proxy_set_header Host $http_host;
49 | proxy_set_header X-NginX-Proxy true;
50 | proxy_pass http://127.0.0.1:8360$request_uri;
51 | proxy_redirect off;
52 | }
53 | }
--------------------------------------------------------------------------------
/conf/xuexb/api.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name api.xuexb.com;
3 |
4 | root /home/xiaowu/wwwroot/api.xuexb.com;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.xuexb.com.conf;
8 |
9 | # 加载公用robots.txt
10 | include inc/robots.conf;
11 |
12 | # 加载公用favicon
13 | include inc/favicon.conf;
14 |
15 | error_log /var/log/nginx/xuexb.com/last/error.api.log warn;
16 | access_log /var/log/nginx/xuexb.com/last/access.api.log main;
17 | }
--------------------------------------------------------------------------------
/conf/xuexb/cache.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name cache.xuexb.com;
3 |
4 | root /home/xiaowu/wwwroot/cache.xuexb.com/;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.xuexb.com.conf;
8 |
9 | # 禁止抓取
10 | include inc/robots.disallow.conf;
11 |
12 | # 加载公用favicon
13 | include inc/favicon.conf;
14 |
15 | error_log /var/log/nginx/xuexb.com/last/error.cache.log warn;
16 | access_log /var/log/nginx/xuexb.com/last/access.cache.log main;
17 |
18 | location / {
19 | expires off;
20 | add_header Cache-Control "no-cache";
21 | add_header Pragma no-cache;
22 | proxy_set_header Connection "";
23 | proxy_set_header X-Real-IP $remote_addr;
24 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25 | proxy_set_header Host $http_host;
26 | proxy_set_header X-NginX-Proxy true;
27 | proxy_pass http://127.0.0.1:8095;
28 | }
29 | }
--------------------------------------------------------------------------------
/conf/xuexb/ci.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name ci.xuexb.com;
3 |
4 | root /home/xiaowu/wwwroot/ci.xuexb.com/;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.xuexb.com.conf;
8 |
9 | # 禁止抓取
10 | include inc/robots.disallow.conf;
11 |
12 | # 加载公用favicon
13 | include inc/favicon.conf;
14 |
15 | error_log /var/log/nginx/xuexb.com/last/error.ci.log warn;
16 | access_log /var/log/nginx/xuexb.com/last/access.ci.log main;
17 |
18 | location ~* \.war$ {
19 | return 404;
20 | }
21 |
22 | # 设置代理不存在文件
23 | location / {
24 | if ( !-f $request_filename ){
25 | rewrite ^/(.*)$ /server.js last;
26 | }
27 | }
28 |
29 | # 代理一个假文件
30 | location = /server.js {
31 | #proxy_http_version 1.1;
32 | proxy_set_header Connection "";
33 | proxy_set_header X-Real-IP $remote_addr;
34 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
35 | proxy_set_header Host $http_host;
36 | proxy_set_header X-NginX-Proxy true;
37 | proxy_pass http://127.0.0.1:8080$request_uri;
38 | proxy_set_header X-Forwarded-Proto https;
39 | proxy_redirect off;
40 | }
41 | }
--------------------------------------------------------------------------------
/conf/xuexb/echo.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name echo.xuexb.com;
3 |
4 | # 加载 SSL 公用配置
5 | include inc/ssl.xuexb.com.conf;
6 |
7 | # 加载公用robots.txt
8 | include inc/robots.conf;
9 |
10 | # 加载公用favicon
11 | include inc/favicon.conf;
12 |
13 | error_log /var/log/nginx/xuexb.com/last/error.echo.log warn;
14 | access_log /var/log/nginx/xuexb.com/last/access.echo.log main;
15 |
16 | expires -1;
17 |
18 | location ^~ /api/cache {
19 | proxy_connect_timeout 10s;
20 | proxy_read_timeout 10s;
21 | proxy_cache nginx_cache;
22 | proxy_cache_valid 200 30d;
23 | proxy_cache_lock on;
24 | proxy_cache_lock_timeout 5s;
25 | proxy_cache_use_stale updating error timeout invalid_header http_500 http_502;
26 | add_header X-Cache-upstream_cache_status "$upstream_cache_status";
27 | add_header X-Cache-upstream_addr "$upstream_addr";
28 | add_header X-Cache-upstream_cookie_name "$upstream_cookie_name";
29 | add_header X-Cache-upstream_header_time "$upstream_header_time";
30 | add_header X-Cache-upstream_http_name "$upstream_http_name";
31 | add_header X-Cache-upstream_response_length "$upstream_response_length";
32 | add_header X-Cache-upstream_response_time "$upstream_response_time";
33 | add_header X-Cache-upstream_status "$upstream_status";
34 |
35 | proxy_set_header Connection "";
36 | proxy_set_header X-Real-IP $remote_addr;
37 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
38 | proxy_set_header Host $http_host;
39 | proxy_set_header X-NginX-Proxy true;
40 | proxy_pass http://127.0.0.1:8001;
41 | }
42 |
43 | location / {
44 | proxy_set_header Connection "";
45 | proxy_set_header X-Real-IP $remote_addr;
46 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
47 | proxy_set_header Host $http_host;
48 | proxy_set_header X-NginX-Proxy true;
49 | proxy_pass http://127.0.0.1:8001;
50 | }
51 | }
52 |
53 | server {
54 | listen 8001;
55 | server_name 127.0.0.1;
56 |
57 | root /home/xiaowu/github/echo.xuexb.com;
58 |
59 | access_log off;
60 | error_log off;
61 |
62 | default_type text/plain;
63 |
64 | location ~* ^/api/dump(\/.*)?$ {
65 | default_type text/html;
66 |
67 | echo '
68 |
69 |
70 |
71 | 输出nginx全局变量
72 |
73 |
74 |
75 |
76 |
77 |
85 |
86 |
119 |
120 |
121 | 输出nginx全局变量
122 | 注意: 本站使用nginx proxy反向代理架设的Https, 所以可能有些参数还是Http的~
';
123 |
124 | echo '服务器相关
125 |
126 |
127 |
128 | 变量名
129 | 结果
130 | 备注
131 |
132 |
133 |
134 |
135 | nginx_version
136 | $nginx_version
137 | 当前运行的nginx版本号
138 |
139 |
140 | server_port
141 | $server_port
142 | 服务器端口
143 |
144 |
145 | server_addr
146 | $server_addr
147 | 服务器端地址,需要注意的是:为了避免访问linux系统内核,应将ip地址提前设置在配置文件中
148 |
149 |
150 |
151 | server_name
152 | $server_name
153 | 服务器名
154 |
155 |
156 |
157 | server_protocol
158 | $server_protocol
159 | 服务器的HTTP版本, 通常为 “HTTP/1.0” 或 “HTTP/1.1”
160 |
161 |
162 |
163 | status
164 | $status
165 | HTTP响应代码
166 |
167 |
168 |
169 | time_iso8601
170 | $time_iso8601
171 | 服务器时间的ISO 8610格式 (1.3.12, 1.2.7)
172 |
173 |
174 |
175 | time_local
176 | $time_local
177 | 服务器时间(LOG Format 格式) (1.3.12, 1.2.7)
178 |
179 |
180 |
181 | document_root
182 | $document_root
183 | 当前请求的文档根目录或别名
184 |
185 |
186 |
187 | request_filename
188 | $request_filename
189 | 当前连接请求的文件路径,由root或alias指令与URI请求生成
190 |
191 |
192 |
193 | request_completion
194 | $request_completion
195 | 如果请求成功,值为”OK”,如果请求未完成或者请求不是一个范围请求的最后一部分,则为空
196 |
197 |
198 |
199 | pid
200 | $pid
201 | 工作进程的PID
202 |
203 |
204 |
205 | msec
206 | $msec
207 | 当前的Unix时间戳 (1.3.9, 1.2.6)
208 |
209 |
210 |
211 | limit_rate
212 | $limit_rate
213 | 用于设置响应的速度限制,详见 limit_rate
214 |
215 |
216 |
217 | pipe
218 | $pipe
219 | 如果请求来自管道通信,值为“p”,否则为“.” (1.3.12, 1.2.7)
220 |
221 |
222 |
223 | connection_requests
224 | $connection_requests
225 | TCP连接当前的请求数量 (1.3.8, 1.2.5)
226 |
227 |
228 |
229 | connection
230 | $connection
231 | TCP连接的序列号 (1.3.8, 1.2.5)
232 |
233 |
234 |
235 | realpath_root
236 | $realpath_root
237 | 当前请求的文档根目录或别名的真实路径,会将所有符号连接转换为真实路径
238 |
239 |
240 |
';
241 |
242 | echo '客户端相关
243 |
244 |
245 |
246 | 变量名
247 | 结果
248 | 备注
249 |
250 |
251 |
252 |
253 |
254 | host
255 | $host
256 | 优先级如下:HTTP请求行的主机名>”HOST”请求头字段>符合请求的服务器名
257 |
258 |
259 |
260 | hostname
261 | $hostname
262 | 主机名
263 |
264 |
265 |
266 | remote_port
267 | $remote_port
268 | 客户端端口
269 |
270 |
271 |
272 | remote_user
273 | $remote_user
274 | 用于HTTP基础认证服务的用户名
275 |
276 |
277 |
278 | request
279 | $request
280 | 代表客户端的请求地址
281 |
282 |
283 |
284 | remote_addr
285 | $remote_addr
286 | 客户端地址
287 |
288 |
289 |
290 | request_body
291 | $request_body
292 | 客户端的请求主体, 此变量可在location中使用,将请求主体通过proxy_pass, fastcgi_pass, uwsgi_pass, 和 scgi_pass传递给下一级的代理服务器
293 |
294 |
295 |
296 | request_body_file
297 | $request_body_file
298 | 将客户端请求主体保存在临时文件中文件处理结束后,此文件需删除如果需要之一开启此功能,需要设置client_body_in_file_only如果将次文件传递给后端的代理服务器,需要禁用request body,即设置proxy_pass_request_body off,fastcgi_pass_request_body off, uwsgi_pass_request_body off, or scgi_pass_request_body off
299 |
300 |
301 |
302 | proxy_protocol_addr
303 | $proxy_protocol_addr
304 | 获取代理访问服务器的客户端地址,如果是直接访问,该值为空字符串(1.5.12)
305 |
306 |
307 |
308 | http_名称
309 | http_accept_language -> $http_accept_language
310 | 匹配任意请求头字段; 变量名中的后半部分“name”可以替换成任意请求头字段,如在配置文件中需要获取http请求头:“Accept-Language”,那么将“-”替换为下划线,大写字母替换为小写,形如:http_accept_language即可
311 |
312 |
313 |
314 | bytes_sent
315 | $bytes_sent
316 | 传输给客户端的字节数 (1.3.8, 1.2.5)
317 |
318 |
319 |
320 | body_bytes_sent
321 | $body_bytes_sent
322 | 传输给客户端的字节数,响应头不计算在内;这个变量和Apache的mod_log_config模块中的“%B”参数保持兼容
323 |
324 |
325 |
';
326 |
327 | echo '客户端相关 - request headers
328 |
329 |
330 |
331 | 变量名
332 | 结果
333 |
334 |
335 |
336 |
337 | http_accept
338 | $http_accept
339 |
340 |
341 | http_accept_encoding
342 | $http_accept_encoding
343 |
344 |
345 | http_accept_language
346 | $http_accept_language
347 |
348 |
349 | http_cache_control
350 | $http_cache_control
351 |
352 |
353 | http_connection
354 | $http_connection
355 |
356 |
357 | http_cookie
358 | $http_cookie
359 |
360 |
361 | http_host
362 | $http_host
363 |
364 |
365 | http_referer
366 | $http_referer
367 |
368 |
369 | http_pragma
370 | $http_pragma
371 |
372 |
373 | http_upgrade_insecure_requests
374 | $http_upgrade_insecure_requests
375 |
376 |
377 | http_user_agent
378 | $http_user_agent
379 |
380 |
381 | http_x_requested_with
382 | $http_x_requested_with
383 |
384 |
385 | http_x_forwarded_for
386 | $http_x_forwarded_for
387 |
388 |
389 |
';
390 |
391 | echo '链接相关
392 |
393 |
394 |
395 | 变量名
396 | 结果
397 | 备注
398 |
399 |
400 |
401 |
402 | scheme
403 | $scheme
404 | 请求使用的Web协议, “http” 或 “https”
405 |
406 |
407 | document_uri
408 | $document_uri
409 | 同 uri
410 |
411 |
412 | request_uri
413 | $request_uri
414 | 这个变量等于包含一些客户端请求参数的原始URI,它无法修改,请查看$uri更改或重写URI,不包含主机名,例如:”/cnphp/test.php?arg=freemouse”
415 |
416 |
417 |
418 | uri
419 | $uri
420 | 请求中的当前URI(不带请求参数,参数位于args),可以不同于浏览器传递的request_uri的值,它可以通过内部重定向,或者使用index指令进行修改,$uri不包含主机名,如”/foo/bar.html”
421 |
422 |
423 |
424 | request_method
425 | $request_method
426 | HTTP请求方法,通常为“GET”或“POST”
427 |
428 |
429 | request_time
430 | $request_time
431 | 处理客户端请求使用的时间 (1.3.9, 1.2.6); 从读取客户端的第一个字节开始计时
432 |
433 |
434 | request_length
435 | $request_length
436 | 请求的长度 (包括请求的地址, http请求头和请求主体) (1.3.12, 1.2.7)
437 |
438 |
439 | query_string
440 | $query_string
441 | 同args
442 |
443 |
444 | args
445 | $args
446 | 请求中的参数值
447 |
448 |
449 | arg_参数名
450 | arg_a => $arg_a
451 | 请求中的的参数名,即“?”后面的arg_name=arg_value形式的arg_name
452 |
453 |
454 | is_args
455 | $is_args
456 | 如果请求中有参数,值为“?”,否则为空字符串
457 |
458 |
459 | https
460 | $https
461 | 如果开启了SSL安全模式,值为“on”,否则为空字符串
462 |
463 |
464 |
';
465 |
466 | echo '';
467 | }
468 |
469 | # 简单的hello, world!
470 | location = /api/hello {
471 | echo "hello, world!";
472 | }
473 |
474 | # 反向代理添加前置、后置内容
475 | location = /api/proxy_before_after {
476 | echo_before_body echo_before_body;
477 | echo_before_body echo_before_body;
478 | proxy_pass http://127.0.0.1;
479 | echo_after_body echo_after_body;
480 | echo_after_body echo_after_body;
481 | }
482 |
483 | # sleep测试
484 | location ~* ^/api/sleep(\/\d*\/?)?$ {
485 | echo "{";
486 | echo " request_uri=$request_uri";
487 |
488 | set $time 2;
489 | if ($uri ~* ^(.+?)/(\d+)/?$) {
490 | set $time $2;
491 | }
492 |
493 | echo_sleep $time;
494 | echo " time=$time";
495 | echo "}";
496 | }
497 |
498 | # 异步调用
499 | location = /api/location_async {
500 | echo location_async;
501 |
502 | # 重置时间
503 | echo_reset_timer;
504 |
505 | # subrequests in parallel
506 | echo_location_async /api/sleep/1;
507 | echo_location_async /api/sleep/2;
508 |
509 | echo "took $echo_timer_elapsed sec for total.";
510 | }
511 |
512 | # 同步调用
513 | location = /api/location {
514 | echo location;
515 |
516 | # 重置时间
517 | echo_reset_timer;
518 |
519 | # subrequests in parallel
520 | echo_location /api/sleep/1;
521 | echo_location /api/sleep/2;
522 |
523 | echo "took $echo_timer_elapsed sec for total.";
524 | }
525 |
526 | # 重复
527 | location = /api/duplicate {
528 | echo_duplicate 3 "hello, world";
529 | }
530 |
531 | # 分隔 ?list=aa,bb
532 | location = /api/split {
533 | echo_foreach_split ',' $arg_list;
534 | echo "item: $echo_it";
535 | echo_end;
536 | }
537 |
538 | # 模拟combo
539 | location = /api/combo {
540 | echo_foreach_split ',' $query_string;
541 | echo "/* combo: $echo_it */";
542 | echo_location_async $echo_it;
543 | echo;
544 | echo_end;
545 | }
546 |
547 | # 输出内容
548 | location ~* ^/api/echo(\/[^\/]*?\/?)?$ {
549 | set $str 'null';
550 | if ($uri ~* ^/api/echo/([^\/]+)/?$) {
551 | set $str $1;
552 | }
553 | echo $str;
554 | }
555 |
556 | location ^~ /api/cache {
557 | echo "请查看 response headers, 由于有缓存请添加随时数来查看最新效果, 如: ?r=时间缀";
558 | }
559 | }
--------------------------------------------------------------------------------
/conf/xuexb/github.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name github.xuexb.com;
3 |
4 | root /home/xiaowu/github/demo;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.xuexb.com.conf;
8 |
9 | # 加载公用robots.txt
10 | include inc/robots.conf;
11 |
12 | # 加载公用favicon
13 | include inc/favicon.conf;
14 |
15 | error_log /var/log/nginx/xuexb.com/last/error.github.log warn;
16 | access_log /var/log/nginx/xuexb.com/last/access.github.log main;
17 |
18 | location = /index.js {
19 | return 403;
20 | }
21 |
22 | # 如果文件不存在
23 | if ( !-f $request_filename ){
24 | rewrite (.*) /server.js;
25 | }
26 |
27 | # 代理所有的md到node上
28 | location ~ \.md$ {
29 | rewrite (.*) /server.js;
30 | }
31 |
32 | # 代理一个假文件
33 | location = /server.js {
34 | #proxy_http_version 1.1;
35 | proxy_set_header Connection "";
36 | proxy_set_header X-Real-IP $remote_addr;
37 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
38 | proxy_set_header Host $http_host;
39 | proxy_set_header X-NginX-Proxy true;
40 | proxy_pass http://127.0.0.1:8888$request_uri;
41 | proxy_redirect off;
42 | }
43 | }
--------------------------------------------------------------------------------
/conf/xuexb/log.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name log.xuexb.com;
3 |
4 | root /home/xiaowu/wwwroot/log.xuexb.com;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.xuexb.com.conf;
8 |
9 | # 禁止抓取
10 | include inc/robots.disallow.conf;
11 |
12 | # 加载公用favicon
13 | include inc/favicon.conf;
14 |
15 | error_log /var/log/nginx/xuexb.com/last/error.log.log warn;
16 | access_log /var/log/nginx/xuexb.com/last/access.log.log main;
17 | #access_log syslog:server=127.0.0.1:8514,tag=mylog,nohostname nginx_cache_json;
18 |
19 | location / {
20 | empty_gif;
21 | }
22 | }
--------------------------------------------------------------------------------
/conf/xuexb/login.mip.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name login.mip.xuexb.com;
3 |
4 | root /home/xiaowu/wwwroot/login.mip.xuexb.com;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.xuexb.com.conf;
8 |
9 | # 加载公用favicon
10 | include inc/favicon.conf;
11 |
12 | error_log /var/log/nginx/xuexb.com/last/error.login.mip.log warn;
13 | access_log /var/log/nginx/xuexb.com/last/access.login.mip.log main;
14 |
15 | location / {
16 | if ( !-f $request_filename ){
17 | rewrite (.*) /server.js last;
18 | }
19 | }
20 |
21 | # 代理一个假文件
22 | location = /server.js {
23 | proxy_http_version 1.1;
24 | proxy_set_header X-Real-IP $remote_addr;
25 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
26 | proxy_set_header Host $http_host;
27 | proxy_set_header X-NginX-Proxy true;
28 | proxy_set_header Upgrade $http_upgrade;
29 | proxy_set_header Connection "upgrade";
30 | proxy_pass http://127.0.0.1:3000$request_uri;
31 | proxy_redirect off;
32 | }
33 | }
--------------------------------------------------------------------------------
/conf/xuexb/mip.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name mip.xuexb.com;
3 |
4 | root /home/xiaowu/github/blog/www;
5 |
6 | location = /robots.txt {
7 | root /home/xiaowu/github/blog/www/mip;
8 | }
9 |
10 | index index.html index.htm;
11 |
12 | # 加载 SSL 公用配置
13 | include inc/ssl.xuexb.com.conf;
14 |
15 | # 加载公用favicon
16 | include inc/favicon.conf;
17 |
18 | error_log /var/log/nginx/xuexb.com/last/error.mip.log warn;
19 | access_log /var/log/nginx/xuexb.com/last/access.mip.log main;
20 |
21 | location ~* ^/[^\/]+\.js$ {
22 | return 403;
23 | }
24 |
25 | # 适配新路由
26 | rewrite ^/html\/(.*)\.html https://mip.xuexb.com/post/$1.html permanent;
27 | # 重写关于我
28 | rewrite ^/about/?$ https://mip.xuexb.com/post/xiaowu.html permanent;
29 |
30 | # 使用location来匹配以字体文件
31 | location ~* \.(eot|otf|ttf|woff|svg)$ {
32 | add_header Access-Control-Allow-Origin *;
33 | }
34 |
35 | # 如果文件不存在认识是后端, 代理到node
36 | if ( !-f $request_filename ){
37 | rewrite (.*) /proxy_node;
38 | }
39 |
40 | location = /proxy_node {
41 | proxy_ignore_headers Set-Cookie;
42 | proxy_hide_header X-Powered-By;
43 | proxy_hide_header vary;
44 |
45 | proxy_set_header Connection "";
46 | proxy_set_header X-Real-IP $remote_addr;
47 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
48 | proxy_set_header Host $http_host;
49 | proxy_set_header X-NginX-Proxy true;
50 | proxy_pass http://127.0.0.1:8360$request_uri;
51 | proxy_redirect off;
52 | }
53 | }
--------------------------------------------------------------------------------
/conf/xuexb/npm.registry.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name npm.registry.xuexb.com;
3 |
4 | # 加载 SSL 公用配置
5 | include inc/ssl.xuexb.com.conf;
6 |
7 | # 加载公用favicon
8 | include inc/favicon.conf;
9 |
10 | error_log /var/log/nginx/xuexb.com/last/error.npm.registry.log warn;
11 | access_log /var/log/nginx/xuexb.com/last/access.npm.registry.log main;
12 |
13 | location / {
14 | proxy_http_version 1.1;
15 | proxy_set_header X-Real-IP $remote_addr;
16 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
17 | proxy_set_header Host $http_host;
18 | proxy_set_header X-NginX-Proxy true;
19 | proxy_set_header Upgrade $http_upgrade;
20 | proxy_set_header Connection "upgrade";
21 | proxy_pass http://127.0.0.1:8110$request_uri;
22 | proxy_redirect off;
23 | }
24 | }
--------------------------------------------------------------------------------
/conf/xuexb/parse.mip.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name parse.mip.xuexb.com;
3 |
4 | root /home/xiaowu/wwwroot/parse.mip.xuexb.com/www;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.xuexb.com.conf;
8 |
9 | # 加载公用favicon
10 | include inc/favicon.conf;
11 |
12 | error_log /var/log/nginx/xuexb.com/last/error.parse.mip.log warn;
13 | access_log /var/log/nginx/xuexb.com/last/access.parse.mip.log main;
14 |
15 | location / {
16 | if ( !-f $request_filename ){
17 | rewrite (.*) /server.js last;
18 | }
19 | }
20 |
21 | # 代理一个假文件
22 | location = /server.js {
23 | proxy_http_version 1.1;
24 | proxy_set_header X-Real-IP $remote_addr;
25 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
26 | proxy_set_header Host $http_host;
27 | proxy_set_header X-NginX-Proxy true;
28 | proxy_set_header Upgrade $http_upgrade;
29 | proxy_set_header Connection "upgrade";
30 | proxy_pass http://127.0.0.1:8022$request_uri;
31 | proxy_redirect off;
32 | }
33 | }
--------------------------------------------------------------------------------
/conf/xuexb/proxy.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | resolver 8.8.8.8;
3 | server_name proxy.xuexb.com;
4 |
5 | root /home/xiaowu/wwwroot/proxy.xuexb.com/;
6 |
7 | # 加载 SSL 公用配置
8 | include inc/ssl.xuexb.com.conf;
9 |
10 | # 禁止抓取
11 | include inc/robots.disallow.conf;
12 |
13 | # 加载公用favicon
14 | include inc/favicon.conf;
15 |
16 | error_log /var/log/nginx/xuexb.com/last/error.proxy.log warn;
17 | access_log /var/log/nginx/xuexb.com/last/access.proxy.log main;
18 |
19 | # 设置主页
20 | location = / {
21 | index index.html;
22 | }
23 |
24 | # 设置代理不存在文件
25 | location / {
26 | if ( !-f $request_filename ){
27 | rewrite ^/(.*)$ /__proxy/$1 last;
28 | }
29 | }
30 |
31 | # 设置假转发
32 | location ~ ^/__proxy/(.*)$ {
33 | proxy_connect_timeout 10s;
34 | proxy_read_timeout 10s;
35 |
36 | proxy_pass http://$1;
37 |
38 | proxy_cache nginx_cache;
39 | proxy_cache_valid 200 30d;
40 | proxy_cache_lock on;
41 | proxy_cache_lock_timeout 5s;
42 | proxy_cache_use_stale updating error timeout invalid_header http_500 http_502;
43 |
44 | add_header X-Cache "$upstream_cache_status from cache.xuexb";
45 |
46 | expires max;
47 | }
48 | }
--------------------------------------------------------------------------------
/conf/xuexb/static.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name static.xuexb.com;
3 |
4 | root /home/xiaowu/wwwroot/static.xuexb.com;
5 |
6 | # 加载ssl证书
7 | include inc/ssl.conf;
8 |
9 | # 加载公用robots.txt
10 | include inc/robots.conf;
11 |
12 | # 加载公用favicon
13 | include inc/favicon.conf;
14 |
15 | # 转发之前的路径
16 | location ~* ^/admin/?$ {
17 | rewrite (.*) https://admin.static.xuexb.com permanent;
18 | }
19 | location ~* ^/mip-parse-html/?$ {
20 | rewrite (.*) https://parse.mip.xuexb.com permanent;
21 | }
22 | location ~* ^/mip-login-app/?$ {
23 | rewrite (.*) https://login.mip.xuexb.com permanent;
24 | }
25 |
26 | error_log /var/log/nginx/xuexb.com/last/error.static.log warn;
27 | access_log /var/log/nginx/xuexb.com/last/access.static.log nginx_cache_json;
28 |
29 | # 使用location来匹配以字体文件
30 | location ~* \.(eot|otf|ttf|woff|svg)$ {
31 | add_header Access-Control-Allow-Origin *;
32 | }
33 | }
--------------------------------------------------------------------------------
/conf/xuexb/status.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name status.xuexb.com;
3 |
4 | root /home/xiaowu/wwwroot/status.xuexb.com;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.xuexb.com.conf;
8 |
9 | # 加载公用favicon
10 | include inc/favicon.conf;
11 |
12 | # 禁止抓取
13 | include inc/robots.disallow.conf;
14 |
15 | error_log /var/log/nginx/xuexb.com/last/error.status.log warn;
16 | access_log /var/log/nginx/xuexb.com/last/access.status.log main;
17 |
18 | location / {
19 | expires off;
20 | add_header Cache-Control "no-cache";
21 | add_header Pragma no-cache;
22 |
23 | proxy_set_header Accept-Encoding "";
24 |
25 | sub_filter_once off;
26 | sub_filter fonts.googleapis.com cdn.con.sh;
27 | sub_filter cdnjs.cloudflare.com cdn.con.sh;
28 | sub_filter ajax.googleapis.com cdn.con.sh;
29 | sub_filter maxcdn.bootstrapcdn.com cdn.con.sh/ajax/libs;
30 | sub_filter http://nixstats-0-1.xuexb.com https://$host;
31 |
32 | proxy_http_version 1.1;
33 | proxy_set_header Connection "";
34 | proxy_set_header X-Real-IP $remote_addr;
35 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
36 | proxy_set_header Host "nixstats-0-1.xuexb.com";
37 | proxy_set_header X-NginX-Proxy true;
38 | proxy_pass http://nixstats-0-1.xuexb.com;
39 | proxy_redirect off;
40 | }
41 | }
--------------------------------------------------------------------------------
/conf/xuexb/v.xuexb.com:
--------------------------------------------------------------------------------
1 | server {
2 | server_name v.xuexb.com;
3 |
4 | root /home/xiaowu/wwwroot/v.xuexb.com;
5 |
6 | expires -1;
7 |
8 | # 加载ssl证书
9 | include inc/ssl.conf;
10 |
11 | # 加载公用robots.txt
12 | include inc/robots.conf;
13 |
14 | # 加载公用favicon
15 | include inc/favicon.conf;
16 |
17 | error_log /var/log/nginx/xuexb.com/last/error.v.log warn;
18 | access_log /var/log/nginx/xuexb.com/last/access.v.log nginx_cache_json;
19 | }
20 |
--------------------------------------------------------------------------------
/conf/xuexb/xuexb.cn.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name xuexb.cn *.xuexb.cn;
3 |
4 | # 加载 SSL 公用配置
5 | include inc/ssl.xuexb.com.conf;
6 |
7 | access_log off;
8 | error_log off;
9 |
10 | rewrite ^(.*) https://xuexb.com$1 permanent;
11 | }
--------------------------------------------------------------------------------
/conf/xuexb/xuexb.com.conf:
--------------------------------------------------------------------------------
1 | proxy_cache_path /var/cache/nginx/xuexb.com levels=1:2 keys_zone=blog_nginx_cache:50m inactive=30d max_size=1g use_temp_path=off;
2 |
3 | server {
4 | server_name xuexb.com www.xuexb.com;
5 | root /home/xiaowu/github/blog/www;
6 |
7 | index index.html index.htm;
8 |
9 | # 加载 SSL 公用配置
10 | include inc/ssl.xuexb.com.conf;
11 |
12 | # 404重写
13 | error_page 404 = /404.html;
14 |
15 | error_log /var/log/nginx/xuexb.com/last/error.log warn;
16 | access_log /var/log/nginx/xuexb.com/last/access.log nginx_cache_json;
17 |
18 | if ( $host != 'xuexb.com' ){
19 | rewrite ^/(.*)$ https://xuexb.com/$1 permanent;
20 | }
21 |
22 | # 禁止访问mip, amp, admin
23 | location ^~ /admin {
24 | return 403;
25 | }
26 | location ^~ /mip {
27 | return 403;
28 | }
29 | location ^~ /amp {
30 | return 403;
31 | }
32 |
33 | # 拒绝访问根目录下的js配置
34 | location ~* ^/[^\/]+\.js$ {
35 | return 403;
36 | }
37 |
38 | if ($request_method !~ ^(GET|HEAD|POST|OPTIONS)$ ) {
39 | return 403;
40 | }
41 |
42 | resolver 114.114.114.114 valid=300s;
43 | resolver_timeout 10s;
44 |
45 | # 适配新路由
46 | rewrite ^/html\/(.*)\.html https://xuexb.com/post/$1.html permanent;
47 | # 重写关于我
48 | rewrite ^/about/?$ https://xuexb.com/post/xiaowu.html permanent;
49 |
50 | etag on;
51 | gzip on;
52 |
53 | # 静态文件
54 | location ^~ /static/ {
55 | add_header Access-Control-Allow-Origin *;
56 | expires max;
57 | }
58 |
59 | # 第三方登录 Demo
60 | # 因为第三方只能在 xuexb.com 域下
61 | location ^~ /web-oauth-app {
62 | proxy_http_version 1.1;
63 | proxy_set_header X-Real-IP $remote_addr;
64 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
65 | proxy_set_header Host $http_host;
66 | proxy_set_header X-NginX-Proxy true;
67 | proxy_set_header Upgrade $http_upgrade;
68 | proxy_set_header Connection "upgrade";
69 | proxy_pass http://127.0.0.1:8020$request_uri;
70 | proxy_redirect off;
71 | }
72 |
73 | # 做 Nginx 缓存
74 | location / {
75 | proxy_cache_revalidate on;
76 |
77 | # 设置缓存和key和时间
78 | proxy_cache blog_nginx_cache;
79 | proxy_cache_key $host$uri$is_args$args;
80 | proxy_cache_methods GET;
81 | proxy_cache_valid 200 304 30d;
82 | proxy_cache_valid any 1h;
83 |
84 | proxy_connect_timeout 10s;
85 | proxy_read_timeout 10s;
86 | proxy_cache_lock on;
87 | proxy_cache_lock_timeout 5s;
88 |
89 | # 当源站500, 502时使用过期的缓存
90 | proxy_cache_use_stale updating error timeout invalid_header http_500 http_502;
91 |
92 | # 链接中有 nocache 时忽略缓存
93 | proxy_cache_bypass $arg_nocache;
94 |
95 | # 添加缓存状态
96 | add_header Nginx-Cache-Status "$upstream_cache_status";
97 |
98 | expires 1h;
99 |
100 | sub_filter_last_modified on;
101 | sub_filter 'echo_nginx_cache_status' ' ';
102 | sub_filter_once on;
103 |
104 | proxy_ignore_headers Set-Cookie;
105 | proxy_hide_header X-Powered-By;
106 | proxy_hide_header vary;
107 |
108 | # 设置代理
109 | proxy_set_header Connection "";
110 | proxy_set_header X-Real-IP $remote_addr;
111 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
112 | proxy_set_header Host $http_host;
113 | proxy_set_header X-NginX-Proxy true;
114 | proxy_pass http://127.0.0.1:8003$request_uri;
115 | proxy_redirect off;
116 | }
117 | }
--------------------------------------------------------------------------------
/conf/xuexb/xzh.mip.xuexb.com.conf:
--------------------------------------------------------------------------------
1 | server {
2 | server_name xzh.mip.xuexb.com;
3 |
4 | root /home/xiaowu/wwwroot/xzh.mip.xuexb.com.404;
5 |
6 | # 加载 SSL 公用配置
7 | include inc/ssl.xuexb.com.conf;
8 |
9 | # 加载公用favicon
10 | include inc/favicon.conf;
11 |
12 | # 禁止抓取
13 | include inc/robots.disallow.conf;
14 |
15 | error_log /var/log/nginx/xuexb.com/last/error.xzh.mip.log warn;
16 | access_log /var/log/nginx/xuexb.com/last/access.xzh.mip.log main;
17 |
18 | location / {
19 | if ( !-f $request_filename ){
20 | rewrite (.*) /server.js last;
21 | }
22 | }
23 |
24 | # 代理一个假文件
25 | location = /server.js {
26 | proxy_http_version 1.1;
27 | proxy_set_header X-Real-IP $remote_addr;
28 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
29 | proxy_set_header Host $http_host;
30 | proxy_set_header X-NginX-Proxy true;
31 | proxy_set_header Upgrade $http_upgrade;
32 | proxy_set_header Connection "upgrade";
33 | proxy_pass http://127.0.0.1:3001$request_uri;
34 | proxy_redirect off;
35 | }
36 | }
--------------------------------------------------------------------------------
/html/disallow/robots.txt:
--------------------------------------------------------------------------------
1 | # xiaowu
2 |
3 | User-agent: *
4 | Disallow: /
--------------------------------------------------------------------------------
/html/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xuexb/nginx-conf/6e99816f64c930f16897d3be9a64f10c1f3acaa5/html/favicon.ico
--------------------------------------------------------------------------------
/html/jiandansousuo.com/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xuexb/nginx-conf/6e99816f64c930f16897d3be9a64f10c1f3acaa5/html/jiandansousuo.com/favicon.ico
--------------------------------------------------------------------------------
/html/robots.txt:
--------------------------------------------------------------------------------
1 | # xiaowu
2 | User-agent: Baiduspider
3 | Allow: /
4 |
5 | User-agent: Sosospider
6 | Allow: /
7 |
8 | User-agent: sogou spider
9 | Allow: /
10 |
11 | User-agent: Googlebot
12 | Allow: /
13 |
14 | User-agent: Bingbot
15 | Allow: /
16 |
17 | User-agent: MSNBot
18 | Allow: /
19 |
20 | User-agent: googlebot-mobile
21 | Allow: /
22 |
23 | User-agent: 360Spider
24 | Allow: /
25 |
26 | User-agent: HaosouSpider
27 | Allow: /
28 |
29 | User-agent: *
30 | Disallow: /
--------------------------------------------------------------------------------
/ssl/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/xuexb/nginx-conf/6e99816f64c930f16897d3be9a64f10c1f3acaa5/ssl/.gitkeep
--------------------------------------------------------------------------------