› NGINX
› NGINX Trac
› 3rd Party Modules
› Security Advisories
› CHANGES
› OpenResty
› ngx_lua
› Tengine
在线学习资源
› NGINX 开发从入门到精通
NGINX Modules
› ngx_echo
stapow
V2EX  ›  NGINX

各位问个 nginx 配置的问题

  •  
  •   stapow · Jun 2, 2016 · 3717 views
    This topic created in 3808 days ago, the information mentioned may be changed or developed.

    绑定虚拟目录然后支持 php 改怎么弄呢?

    location /pan { alias /home/wwwroot/default; location ~ .php$ { fastcgi_split_path_info ^(.+?.php)(/.*)?$; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include fastcgi_params; }

    }

    想把 xxx.com/pan 映射到 /home/wwwroot/default 并能执行 php 始终不能啊,不知道该如何是好。

    5 replies  •  2016-06-03 15:12:32 +08:00
    surfire91
    surfire91
    Jun 2, 2016
    1
    你这格式没法阅读啊,
    好像 location 还嵌套 location 了?
    stapow
    stapow
    OP
    Jun 2, 2016
    2
    @surfire91 stackflow 里面找到的。。。
    cevincheung
    cevincheung
    Jun 2, 2016
    3
    为啥到现在还在纠结各种 pathinfo 的问题。
    ryd994
    ryd994
    Jun 2, 2016
    4
    嵌套 location 是允许的
    看不出什么问题
    看 error.log
    Niphor
    Niphor
    Jun 3, 2016
    5
    估计 没定义 SCRIPT_FILENAME 吧...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1298 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 19:24 · PVG 03:24 · LAX 11:24 · JFK 14:24
    ♥ Do have faith in what you're doing.