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 · 3347 views
    This topic created in 3647 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
        1
    surfire91  
       Jun 2, 2016
    你这格式没法阅读啊,
    好像 location 还嵌套 location 了?
    stapow
        2
    stapow  
    OP
       Jun 2, 2016
    @surfire91 stackflow 里面找到的。。。
    cevincheung
        3
    cevincheung  
       Jun 2, 2016
    为啥到现在还在纠结各种 pathinfo 的问题。
    ryd994
        4
    ryd994  
       Jun 2, 2016
    嵌套 location 是允许的
    看不出什么问题
    看 error.log
    Niphor
        5
    Niphor  
       Jun 3, 2016
    估计 没定义 SCRIPT_FILENAME 吧...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   930 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 20:55 · PVG 04:55 · LAX 13:55 · JFK 16:55
    ♥ Do have faith in what you're doing.