发布时间:2013-01-10 16:54:01
if ( !-d baidu) { rewrite ^(.*)$ http://www.baidu.com permanent;}if ( $host !="www.ttpod.com") { rewrite ^(.*)$ http://www.ttpod.com permanent;}location / { set $domain default; if ( $http_host ~* "www\.ttpod\.com") { set $domain $1;} rewrite ^/(.*) /test/$domain/$1 last;} ......【阅读全文】
发布时间:2013-01-10 16:38:23
1. Nginx upstream code 点击(此处)折叠或打开upstream tomcat_ttpod { server 10.0.0.1:10080 max_fails=3 fail_timeout=30s; server 10.0.0.2:10080 max_fails=3 fail_timeout=30s; server 10.0.0.3:10080 backup;server { listen 80; server_name www.ttpod.com ttpod.com; index index.htm index.html;location ~ .*\.(gif|jpg|......【阅读全文】
发布时间:2013-01-10 13:41:19
例1: 将 www.a.com跳转到 www.a.com/a 点击(此处)折叠或打开server { listen 80; server_name www.a.com www.b.com www.c.com; index index.htm index.html;location / { root /data/webroot;}if ($host ~* "www\.a\.com") { rewrite ^(.*)$ /a/index.html break; }} 例2: 将 a b c 三个目录跳转到首页 点击(此处)折叠或打开......【阅读全文】