冠富商务通中文社区

 找回密码
 立即注册
查看: 8|回复: 0
打印 上一主题 下一主题
收起左侧

[建站经验] 【nginx伪静态配置文件】-Nginx的Z-Blog的伪静态配置方法

[复制链接]
跳转到指定楼层
楼主
发表于 2017-10-29 03:24:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本站是在LNMP环境下运行,参考Nginx的Z-Blog的静态配置



复制代码代码如下:
server {
        listen       80;
        server_name jb51.net blog.jb51.net www.jb51.net;
        root /www/web/www_jb51_net/public_html;
        index  index.html index.php index.htm;
        error_page  400 /errpage/400.html;
        error_page  403 /errpage/403.html;
        error_page  404 /errpage/404.html;
        location ~ \.php$ {
                proxy_pass http://127.0.0.1:88;
                include naproxy.conf;
                #include ./rewrite/z-blog_nginx.conf;
rewrite ^/post/([0-9]+).html$ /index.php?id=$1 last;
rewrite ^/([0-9]+).html$ /index.php?id=$1 last;
rewrite ^/(?:page_)?([0-9]*).html$ /index.php?page=$1 last;
rewrite ^/category-([0-9]+)(?:_)?([0-9]*).html$ /index.php?cate=$1page=$2 last;
rewrite ^/date-([0-9-]+)(?:_)?([0-9]*).html$ /index.php?date=$1page=$2 last;
rewrite ^/author-([0-9]+)(?:_)?([0-9]*).html$ /index.php?auth=$1page=$2 last;
rewrite ^/tags-([0-9]+)(?:_)?([0-9]*).html$ /index.php?tags=$1page=$2 last;
        }
        location / {
                try_files $uri @apache;
        }
        location @apache {
                 proxy_pass http://127.0.0.1:88;
                 include naproxy.conf;
        }
}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|关于我们|申请友链|Archiver|手机版|拘留所|冠富商务通

GMT+8, 2026-3-28 23:08 , Processed in 0.074005 second(s), 17 queries , Wincache On.

Powered by HCMS Version 2.0

© 2008-05-14 guanfu.net.cn

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