前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >博客的nginx.conf文件

博客的nginx.conf文件

作者头像
zgq354
发布2019-11-25 10:35:53
6070
发布2019-11-25 10:35:53
举报
文章被收录于专栏:0x00010x0001

在这里分享一下我的博客的nginx.conf文件,因为nginx对pathinfo支持总是有那么一点问题。。参考了下70的写法,然后弄出了下面那些玩意儿。。表示工作十分正常(用的lnmp.org的lnmp一键安装包)

server{
    listen 80;
    server_name blog.izgq.net;
    index index.php index.html;
    root  /home/wwwroot/blog;

    location /
            {
                try_files $uri $uri/ /index.php?$args;
            }
    location ~ [^/]\.php(/|$) {
                        fastcgi_split_path_info ^(.+\.php)(/.+)$;
                        fastcgi_pass  unix:/tmp/php-cgi.sock;
                        fastcgi_index index.php;
                        fastcgi_param PATH_INFO $fastcgi_path_info;
                        include fastcgi.conf;
                    }
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
            #try_files $uri $uri/ /index.php$is_args$args;
            expires      30d;
        }
    location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

    access_log off;
}

用它的时候你只需要把站点目录和域名换掉就行了 ^__^

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2015-02-10,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档