nginx、thinkphp3.2、linux配置文件配置

nginx.conf配置文件:

    server {
        listen 9001;
        server_name 127.0.0.1;
        index index.php;
        root /data/mobissp/mobissp_ad/;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;
        #include /mnt/project/.htaccess;
        
        location / {
                #index index.php;
                #ThinkPHP REWRITE支持
                #if (!-e  $request_filename) {
                #    rewrite ^/(.*)$ /index.php?s=$1 last;
                #}
                
                if (!-e $request_filename) {
                   rewrite  ^(.*)$  /index.php?s=$1  last;
                }
       }
        
        location ~ \.php$ {
            fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
            
        }
    }

thinkphp3.2的url模式要改

URL_MODEL要改为3

猜你喜欢

转载自blog.csdn.net/shj_php/article/details/82891460