VPS侦探论坛

 找回密码
 注册
查看: 4269|回复: 2

rewrite的问题

[复制链接]
发表于 2016-2-6 09:03:31 | 显示全部楼层 |阅读模式

#error_page   404   /404.html;

            #Custom rules Start
    rewrite ^/debs/([^/]+) /downloads.php?request=$1;
    rewrite ^/(Release)$ /lists.php?request=Release;
    rewrite ^/(Packages)$ /lists.php?request=Packages;
    rewrite ^/(Packages\.gz)$ /lists.php?request=Packages.gz;
    rewrite ^/(Packages\.bz2)$ /lists.php?request=Packages.bz2;
    rewrite ^/(rewritetest)$ /robots.txt;
    rewrite ^/view/([0-9]+)(.*) /index.php?method=view&pid=$1;
    rewrite ^/view/([0-9]+)/nohistory /index.php?method=view&pid=$1&addr=nohistory;
    rewrite ^/screenshot/([0-9]+)(.*) /index.php?method=screenshot&pid=$1;
    rewrite ^/history/([0-9]+)(.*) /index.php?method=history&pid=$1;
    rewrite ^/contact/([0-9]+)(.*) /index.php?method=contact&pid=$1;
    rewrite ^/section/([0-9]+)(.*) /index.php?method=section&pid=$1;
    rewrite ^/report/([0-9]+)/([0-9]+)(.*) /index.php?method=report&pid=$1&support=$2;
    rewrite ^/report/([0-9]+)(.*) /index.php?method=report&pid=$1;
    rewrite ^/more/([0-9]+)/([0-9]+)(.*) /index.php?method=more&pid=$1&offset=$2;
    rewrite ^/more/([0-9]+)(.*) /index.php?method=more&pid=$1;
    rewrite ^/more/([0-9]+)(.*) /index.php?method=more&pid=$1;
    rewrite ^/(misc)$ /misc.php;    #Custom rules End

        location ~ [^/]\.php(/|$)
        {
            # comment try_files $uri =404; to enable pathinfo
            try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
            #include pathinfo.conf;
        }


rewrite放这 怎么没有生效啊。0.0
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2016-2-6 19:20:21 | 显示全部楼层


放的位置没错,只要伪静态没问题,重启nginx就能生效
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2016-2-6 19:57:41 | 显示全部楼层

回复 2# 的帖子


我用include了,好了,谢谢
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-17 19:04 , Processed in 0.027782 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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