zoukankan      html  css  js  c++  java
  • nginx上布置thinkphp

    thinkphp config配置:

    'URL_MODEL'          => '2', //URL模式

    nginx rewrite配置:

    location / {
            set $static 0;
            if  ($uri ~ .(css|js|jpg|jpeg|png|gif|ico|woff|eot|svg|css.map|min.map)$) {
                            root    /data/www;
                            set $static 1;
            }
            if (!-e $request_filename){
                            set $static 0$static;
            }
            if ($static = 00){
                            rewrite  ^/(.*)$  /index.php?s=$1  last;
            }
    }

    如果你的ThinkPHP安装在二级目录,Nginx的伪静态方法设置如下,其中youdomain是所在的目录名称

    location /yourdomain/ {
            set $static 0;
            if  ($uri ~ .(css|js|jpg|jpeg|png|gif|ico|woff|eot|svg|css.map|min.map)$) {
                            root    /data/www;
                            set $static 1;
            }
            if (!-e $request_filename){
                            set $static 0$static;
            }
            if ($static = 00){
                            rewrite  ^/yourdomain/(.*)$  /yourdomain/index.php?s=$1  last;
            }
    }
  • 相关阅读:
    基于flask的web微信
    Scrapy框架
    python爬虫之Selenium
    python爬虫之request and BeautifulSoup
    CMDB的四种模式
    Django之CURD插件2
    Django之CURD插件
    在代码中使用Autolayout – intrinsicContentSize和Content Hugging Priority
    iOS事件传递&响应者链条
    CAEmitterLayer 粒子发射Layer的相关属性
  • 原文地址:https://www.cnblogs.com/wuxie1989/p/5482608.html
Copyright © 2011-2022 走看看