nginx configuration uses load the index.php file as the default directory

Configuration is as follows:

Add a line in the server:

index index.php index.html index.htm default.php default.htm default.html

After the increase are as follows:

server
{
    listen 100;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/manager/public;
 
    include enable-php-70.conf;
 
        if (!-e $request_filename) {
                rewrite ^/(.+)$ /index.php last;
        }
 
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
                expires 30d;
        }
        location ~ .*\.(js|css)?$
        {
                expires 1h;
        }
        location /.git
        {
                deny all;
                return 403;
        }
    access_log  /www/wwwlogs/manager.com.log;
    error_log  /www/wwwlogs/manager.com.error.log;
}

 

Guess you like

Origin www.cnblogs.com/liyuanhong/p/12066111.html