zoukankan      html  css  js  c++  java
  • Nginx下部署TP5项目

    标签(空格分隔): linux


    nginx配置文件:

    server
    {   
        listen 81; 
        #listen [::]:80;
        server_name _;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/thinkphp5.0.5/public;
    
        include rewrite/other.conf;
        #error_page   404   /404.html;
    
        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*.php$ { deny all; }
    
        include enable-php-pathinfo.conf;
        
        # --start--- TP5加上这一块 支持pathinfo
        if (!-e $request_filename) {
            rewrite ^/(.*)$ /index.php/$1 last;
            break;
        }   
    
        location ~ [^/].php(/|$) {
            fastcgi_split_path_info ^(.+.php)(/.+)$;
            try_files $fastcgi_script_name =404;
            set $path_info $fastcgi_path_info;
            fastcgi_param PATH_INFO $path_info;
            fastcgi_pass unix:/dev/shm/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
        }   
        # --end--- TP5加上这一块 支持pathinfo
    
    
        location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
        {   
            expires      30d;
        }   
    
        location ~ .*.(js|css)?$
        {   
            expires      12h;
        }
        
        location ~ .*.(js|css)?$
        {   
            expires      12h;
        }   
    
        location ~ /.well-known {
            allow all;
        }
    
        location ~ /.
        {
            deny all;
        }
    
        access_log  /home/wwwlogs/thinkphp5.0.5.log;
    }
  • 相关阅读:
    SysRq组合键是一组"魔术组合键"
    iptables FTP脚本
    (转)SSH的端口转发
    进制转换
    指定的参数已超出有效值的范围
    静态类
    接口
    快捷键,移到最上层
    gitbook
    nginx服务无法停止(Windows)
  • 原文地址:https://www.cnblogs.com/yanweifeng/p/10100768.html
Copyright © 2011-2022 走看看