thinkphp、laravel、CI、YII2 等Nginx配置
1、thinkphp location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } } 2、laravel location / { try_files $uri $uri/ /index.php?$query_string; } 3、CI location / { try_files $uri $uri/ /index.php; } 4、YII2 location / { # Redirect everything that isn't a real file to index.php try_files $uri $uri/ /index.php$is_args$args; } 5、typecho if (!-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; } 6、typecho2 location /typecho/ { if (!-e $request_filename) { rewrite ^(.*)$ /typecho/index.php$1 last; } } 7、wordpress location / { try_files $uri $uri/ /index.php?$args; }