免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2070 | 回复: 0
打印 上一主题 下一主题

apache正常解析 php 而nginx代理过去成下载 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-09-20 19:49 |只看该作者 |倒序浏览
apache正常解析 php 而nginx代理过去成下载


apache端口在81  通过ip:81 访问 可以解析出php  但是开启nginx 后  通过ip访问html 正常  访问php 却无法通过代理 到后端的apache  求解,谢谢

ps:nginx 版本 1.1.3 谢谢

附 配置文件:

  1. hello.conf


  2. server
  3. {
  4. listen  80;
  5. server_name    192.168.1.133;
  6. index index.html index.htm index.php;
  7. root    /data/www/;

  8. location /nginx {
  9. stub_status on;
  10. auth_basic  "NginxStatus";


  11. access_log off;
  12. }



  13. location ~ .*/.(php|php5)?$ {
  14. # index index.php;
  15. # root /data/www/;   去这俩行后情况依旧
  16. proxy_pass    http://127.0.0.1:81;
  17. }

  18. include proxy.conf;

  19. if ( !-e $request_filename) {
  20. proxy_pass  http://127.0.0.1:81;
  21. }

  22. location ~* /.(jpg|jpeg|gif|png|swf)$ {
  23. if (-f $request_filename) {
  24. root /data/www/;
  25. expires    30d;
  26. break;}
  27. }
  28. location ~* /.(js|css)$ {
  29. if (-f $request_filename) {
  30. root /data/www/;
  31. expires    1d;
  32. break;
  33. }
  34. }
  35. }

  36. error_page   500 502 503 504  /50x.html;
  37. location = /50x.html {
  38. root   html;
  39. }



  40. }
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP