nginx 配置文件请教

云天河V 2017-07-26 02:18:19
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走静态解析,请问怎么做?
...全文
126 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,657

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧