美文网首页
TP5 PHP74 NGINX

TP5 PHP74 NGINX

作者: 罐头过期 | 来源:发表于2020-03-23 21:29 被阅读0次

    以下是THINKPHP5 中配置PHP74-FPM 在Nginx服务中得配置文件

    server {
            listen 80;
            server_name a.cn www.a.cn;
            root /www/eg;
            set $root /www/eg;
    #php 解析
      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 127.0.0.1:9000;
            fastcgi_index index.php;
            include fastcgi.conf;
      }
    
    
        location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$
        {
            root $root;
        }
    
        location / {
            root    $root;
            index    index.html index.php;
    #TP5 得路由规则
           if ( !-e $request_filename) {
                rewrite ^/(.*)$ /index.php/$1 last;
                break;
            }
        }
    }
    
    

    相关文章

      网友评论

          本文标题:TP5 PHP74 NGINX

          本文链接:https://www.haomeiwen.com/subject/rypgyhtx.html