TP5 PHP74 NGINX

2020-03-23  本文已影响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;
        }
    }
}

上一篇下一篇

猜你喜欢

热点阅读