VPS侦探论坛

 找回密码
 注册
查看: 4732|回复: 1

求助nginx配置问题

[复制链接]
发表于 2014-2-10 12:23:49 | 显示全部楼层 |阅读模式

我现在在测试  LOGA 日志系统 他们需要配置下nginx 他们的配置说明是这样

#PHP部分:
location ~ \.php {
    # 以下两行为避免,*.php文件不存在,而PHP-FPM(PHP FastCGI) 返回No input file specified错误,直接指向站点根目录下的404.html
    try_files $uri /www/lib/404/404.error.html;
    fastcgi_intercept_errors off;
    fastcgi_pass    127.0.0.1:9999;
    fastcgi_index    index.php;
    fastcgi_param    SCRIPT_FILENAME    $document_root$fastcgi_script_name;
    include            fastcgi_params;

    # 以下是为了让Nginx支持PATH_INFO
    set $path_info "";
    set $real_script_name $fastcgi_script_name;
    if($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
        set $real_script_name $1;
        set $path_info $2;
    }
    fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
    fastcgi_param SCRIPT_NAME $real_script_name;
    fastcgi_param PATH_INFO $path_info;

    fastcgi_connect_timeout    120;
    fastcgi_send_timeout    120;
    fastcgi_read_timeout    120;
    fastcgi_buffers            8 128K;
    fastcgi_buffer_size        128K;
}


#站点部分:
server {
    listen            80;
    server_name        asthis.net;
    root            /www/root/uwa;
    charset            UTF-8;

    location / {
        if(!-e $request_filename){
            rewrite ^/(.*)$ /index.php/$1 last;
        }
        index    index.php;
    }
    include        php;
    include        error;
}



请高手给写个lnmp环境下的配置文件 谢谢。。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-2-10 14:00:12 | 显示全部楼层


支持pathinfo早就说过了,提问前先搜索
https://bbs.vpser.net/viewthread ... ;fromuid=3#pid29934
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 09:38 , Processed in 0.025274 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表