Operating Environment
CentOS 6.5 + LANMP
Apache as back end, nginx as front end
Software: WordPress
Nginx Virtual Host configuration is as follows:
server {
Listen 80;
server_name xxx.com;
root/var/www/xxx/html;
Index index.html index.htm index.php;
#这句是wordpress的rewriter语句location / { try_files $uri $uri/ /index.php?q=$uri&$args;}#php文件转发给apache处理location ~ \.(php)?$ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://127.0.0.1:8080;}
}
If it is in the LNMP environment, the following rewrite statement is no problem
Location/{
Try_files $uri $uri//index.php?q= $uri & $args;
}
However, in the LANMP environment, after clicking on the address, the address bar is changed, the page displayed is the homepage. Do not know where is wrong?
Fixed link style: http://xxx.com/xxx/
Reply content:
Operating Environment
CentOS 6.5 + LANMP
Apache as back end, nginx as front end
Software: WordPress
Nginx Virtual Host configuration is as follows:
server {
Listen 80;
server_name xxx.com;
root/var/www/xxx/html;
Index index.html index.htm index.php;
#这句是wordpress的rewriter语句location / { try_files $uri $uri/ /index.php?q=$uri&$args;}#php文件转发给apache处理location ~ \.(php)?$ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://127.0.0.1:8080;}
}
If it is in the LNMP environment, the following rewrite statement is no problem
Location/{
Try_files $uri $uri//index.php?q= $uri & $args;
}
However, in the LANMP environment, after clicking on the address, the address bar is changed, the page displayed is the homepage. Do not know where is wrong?
Fixed link style: http://xxx.com/xxx/
location / { try_files $uri @apache ;}location @apache { internal; proxy_pass http://127.0.0.1:8080;}