server
{
listen 80;
server_name xx.cn;
index index.php index.html index.htm default.php default.htm default.html;
location /qyzg/ {
root /home/wwwroot/zhibo/testgzh/;
try_files $uri $uri/ /qyzg_index.html last;
break;
}
root /home/wwwroot/zhibo/gzh/web;
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ .*\.*chunk.*(js|css)?$
{
expires 12h;
error_log off;
access_log /dev/null;
if (!-e $request_filename) {
root /home/wwwroot/zgkc/;
break;
}
}
location ~ .*\.*app.*(js|css)?$
{
expires 12h;
error_log off;
access_log /dev/null;
if (!-e $request_filename) {
root /home/wwwroot/zgkc/;
break;
}
}
location ~ .*\.*chunk.*(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log off;
access_log /dev/null;
if (!-e $request_filename) {
root /home/wwwroot/zgkc/;
break;
}
}
#通過訪問二級目錄order來訪問訂單服務服務器
location /zgzj/ {
proxy_pass http://xx.cn/;
}
access_log /www/wwwlogs/xx.cn.log;
error_log /www/wwwlogs/xx.cn.error.log;
}
主要是這行代碼 反向代理
location /zgzj/ {
proxy_pass http://bb4.xx.cn/;
}