V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
stapow
V2EX  ›  NGINX

各位问个 nginx 配置的问题

  •  
  •   stapow · 2016-06-02 17:30:15 +08:00 · 2456 次点击
    这是一个创建于 2878 天前的主题,其中的信息可能已经有所发展或是发生改变。

    绑定虚拟目录然后支持 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 条回复    2016-06-03 15:12:32 +08:00
    surfire91
        1
    surfire91  
       2016-06-02 18:56:13 +08:00
    你这格式没法阅读啊,
    好像 location 还嵌套 location 了?
    stapow
        2
    stapow  
    OP
       2016-06-02 20:01:40 +08:00
    @surfire91 stackflow 里面找到的。。。
    cevincheung
        3
    cevincheung  
       2016-06-02 20:04:05 +08:00
    为啥到现在还在纠结各种 pathinfo 的问题。
    ryd994
        4
    ryd994  
       2016-06-02 20:28:34 +08:00
    嵌套 location 是允许的
    看不出什么问题
    看 error.log
    Niphor
        5
    Niphor  
       2016-06-03 15:12:32 +08:00
    估计 没定义 SCRIPT_FILENAME 吧...
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1134 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 71ms · UTC 18:24 · PVG 02:24 · LAX 11:24 · JFK 14:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.