美文网首页
TP框架的pathinfo

TP框架的pathinfo

作者: Mracale | 来源:发表于2023-12-14 14:58 被阅读0次

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    # SSL configuration

    # listen 443 ssl default_server;
    # listen [::]:443 ssl default_server;


    root /var/www/html/public;

    # Add index.php to the list if you are using PHP
    index index.php index.html index.htm index.nginx-debian.html;

    server_name _;
        # 去掉url中的index.php
    location / {

        try_files $uri $uri/ =404;
        if (!-e $request_filename){
                   rewrite ^/(.*)$ /index.php?s=/$1 last;
                }
    }

    # pass PHP scripts to FastCGI server

        location ~ \.php(.*)$ {
            include snippets/fastcgi-php.conf;
           fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
            fastcgi_param PATH_INFO $1;
    }

}

相关文章

网友评论

      本文标题:TP框架的pathinfo

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