nginx的使用 window

166 阅读1分钟

启动:start nginx.exe

停止:.\nginx -s stop

发布前端项目:

location /{   root   dist;   try_files $uri $uri/ /index.html;//vue项目使用history模式时,需要配置该属性   index  index.html;}

发布静态资源

location / {   root  E:/KKB;   autoindex on;}

配置代理:

location  /api{   rewrite ^/api/(.*)$ /$1 break;   proxy_pass  http://mt1.google.cn/vt/;}