server {
listen 80;
server_name man.cn;
root /usr/local/www/test_demo/htdocs/public;
index index.php index.html index.htm;
charset utf-8;
if ( $request_uri ~* ^(/web)){
rewrite ^/web/(.*)$ /dist/index.html;
}
if ( $request_uri ~* ^(/api)){
rewrite ^/api/(.*)$ /index.php?=url=$1 last;
}
location ^~ / {
rewrite /dist/(.+)$ /$1 break;
proxy_pass http://man.com/web/dashboard/;
}
location ~ \.php {
fastcgi_pass 127.0.0.1:9071;
fastcgi_index /index.php;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
请教一下,现在想实现这样的效果:
我们现在的效果是;
http://man.cn/web/dashboard带web走静态解析
http://man.cn/api/test/ak带api走php解析
现在想实现的是http://man.cn走静态解析,请问怎么做?