Thinkphp + minify configuration method on nginx server (easy-admin)

Source: Internet
Author: User
Tags nginx server

The configuration method of the nginx configuration file is as follows:

[Code] bash code:
Server {
Listen 80;
Server_name www. php2.cc; # Here is the site url
Root/home/www/php2; # The Site root directory

Location /{
Index index.htm index.html index. php admin. php;

Rewrite ^/Public/Min/(. *) $/Public/Min/index. php/$1 last;
Rewrite ^ ([a-z] =. *)/Public/Min/index. php? $1 last;
# If the file in the access path does not exist, rewrite the URL and forward it to ThinkPHP for processing.
If (! -E $ request_filename ){
Rewrite ^/(. *) $/index. php/$1 last;
Break;
        } 
    } 
Location ~ \. Php /?. * $ {
Fastcgi_pass 127.0.0.1: 9000;
Fastcgi_index index. php;
# Load Nginx default "server environment variable" configuration
Include fastcgi. conf;
         
# Set PATH_INFO and rewrite the SCRIPT_FILENAME and SCRIPT_NAME server environment variables
Set $ fastcgi_script_name2 $ fastcgi_script_name;
If ($ fastcgi_script_name ~ "^ (. + \. Php) (/. +) $ "){
Set $ fastcgi_script_name2 $1;
Set $ path_info $2;
        } 
Fastcgi_param PATH_INFO $ path_info;
Fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name2;
Fastcgi_param SCRIPT_NAME $ fastcgi_script_name2;
    } 
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.