- 论坛徽章:
- 0
|
apache正常解析 php 而nginx代理过去成下载
apache端口在81 通过ip:81 访问 可以解析出php 但是开启nginx 后 通过ip访问html 正常 访问php 却无法通过代理 到后端的apache 求解,谢谢
ps:nginx 版本 1.1.3 谢谢
附 配置文件:
- hello.conf
- server
- {
- listen 80;
- server_name 192.168.1.133;
- index index.html index.htm index.php;
- root /data/www/;
- location /nginx {
- stub_status on;
- auth_basic "NginxStatus";
- access_log off;
- }
- location ~ .*/.(php|php5)?$ {
- # index index.php;
- # root /data/www/; 去这俩行后情况依旧
- proxy_pass http://127.0.0.1:81;
- }
- include proxy.conf;
- if ( !-e $request_filename) {
- proxy_pass http://127.0.0.1:81;
- }
- location ~* /.(jpg|jpeg|gif|png|swf)$ {
- if (-f $request_filename) {
- root /data/www/;
- expires 30d;
- break;}
- }
- location ~* /.(js|css)$ {
- if (-f $request_filename) {
- root /data/www/;
- expires 1d;
- break;
- }
- }
- }
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
复制代码 |
|