Nginx 基础配置

in Linux with 0 comment

伪静态

location / {  
    try_files $uri $uri/ /index.php$is_args$query_string;
}

重定向配置

set $root_path '';

if ( $request_uri !~* /api ) {
    set $root_path /www/wwwroot/tutor/resources/dist;
}

if ( $request_uri ~* /(api|storage) ) {
    set $root_path /www/wwwroot/tutor/public;
}

root $root_path;

location ~* .(jpg|gif|png|js|css)$ {
    root /var/www/html;
}
Comments are closed.