VPS侦探论坛

 找回密码
 注册
查看: 10855|回复: 10

最新版本的lnmp如何开启pathinfo支持,迷茫中

[复制链接]
发表于 2014-8-13 20:52:34 | 显示全部楼层 |阅读模式

按照论坛的方法修改之后网站一直提示502错误,求教该如何弄呢
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-8-14 10:31:17 | 显示全部楼层


添加pathinfo支持,去掉include pathinfo的#,在try_files前加#重启nginx即可使用;

502的话可能其他原因,还修改其他配置吗?用的什么程序
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-8-14 11:05:14 | 显示全部楼层

老大,
添加pathinfo支持,去掉include pathinfo的#,在try_files前加#重启nginx即可使用;
我从nginx.conf里面没有看到include pathinfo。我按照你的一个方法修改了pathinfo.conf里面的内容,后来就出现了502错误,如果是新安装的话,nginx.conf里面没有include pathinfo该怎么办呢?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-8-14 13:32:04 | 显示全部楼层



你如果是安装的1.1肯定有,除非修改配置文件去掉了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-8-15 14:14:38 | 显示全部楼层

老大,我重新安装了下,我还是没看到那个Include


这是我的nginx.conf内容
user  www www;

worker_processes auto;

error_log  /home/wwwlogs/nginx_error.log  crit;

pid        /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events
        {
                use epoll;
                worker_connections 51200;
                multi_accept on;
        }

http
        {
                include       mime.types;
                default_type  application/octet-stream;

                server_names_hash_bucket_size 128;
                client_header_buffer_size 32k;
                large_client_header_buffers 4 32k;
                client_max_body_size 50m;

                sendfile on;
                tcp_nopush     on;

                keepalive_timeout 60;

                tcp_nodelay on;

                fastcgi_connect_timeout 300;
                fastcgi_send_timeout 300;
                fastcgi_read_timeout 300;
                fastcgi_buffer_size 64k;
                fastcgi_buffers 4 64k;
                fastcgi_busy_buffers_size 128k;
                fastcgi_temp_file_write_size 256k;

                gzip on;
                gzip_min_length  1k;
                gzip_buffers     4 16k;
                gzip_http_version 1.0;
                gzip_comp_level 2;
                gzip_types       text/plain application/x-javascript text/css application/xml;
                gzip_vary on;
                gzip_proxied        expired no-cache no-store private auth;
                gzip_disable        "MSIE [1-6]\.";

                #limit_conn_zone $binary_remote_addr zone=perip:10m;
                ##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.

                #log format
                log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';

server
        {
                listen 80 default;
                #listen [::]:80 default ipv6only=on;
                server_name www.lnmp.org;
                index index.html index.htm index.php;
                root  /home/wwwroot/default;

                location / {
                        try_files $uri @apache;
                        }

                location @apache {
                        internal;
                        proxy_pass http://127.0.0.1:88;
                        include proxy.conf;
                        }

                location ~ [^/]\.php(/|$)
                        {
                                proxy_pass http://127.0.0.1:88;
                                include proxy.conf;
                        }

                location /nginx_status {
                        stub_status on;
                        access_log   off;
                }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                access_log  /home/wwwlogs/access.log  access;
        }
include vhost/*.conf;
}

军哥运维代购:http://shop63846532.taobao.com/

发表于 2014-8-15 17:11:46 | 显示全部楼层

你先分清楚你到底用的什么,看配置文件你明显是用的lnmpa
lnmpa是apache处理
 楼主| 发表于 2014-8-15 18:09:40 | 显示全部楼层

现在是前台ng 后台apache


现在是前台ng 后台apache,那该怎么解决呢
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-8-15 20:05:50 | 显示全部楼层

lnmpa默认就支持pathinfo,不需要设置,也不需要改什么
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-8-15 20:27:33 | 显示全部楼层


可是,我新安装了之后,无法访问xxx.xxx/xxx这样的格式,带上后缀就可以正常了,提示404错误,那是什么问题呢
,难道是少安装了什么?

军哥运维代购:http://shop63846532.taobao.com/

发表于 2014-8-15 21:22:03 | 显示全部楼层

回复 9# 的帖子




pathinfo不都是 http://www.xx.com/pathinfo.php/hi2014 这种的
没.php的那是伪静态吧
 楼主| 发表于 2014-8-15 22:17:13 | 显示全部楼层

哦。pathinfo不都是 http://www.xx.com/pathinfo.php/hi2014 这种后面加上.php内容是同样的么。如果是伪静态的话那就要自己写规则了或者不适用ng
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-26 01:24 , Processed in 0.028126 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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