Packed into nginx

1. dist play a .zip package

2. Change to the directory upload files and extract with

3. Move to the specified folder as web-vue

  whereis nginx ---- where the file directory inquiry nginx

  pwd ---- current path

  vim nginx.config ---- edit files

4. Modify profile nginx  

location / { 
     root / web-vue; # / for the root 
     try_file $ uri $ uri / /index.html; # find the current url, or find the current url of /, otherwise look for index.html
 } 

5. SPA project need to configure rewrite, or try_file

6. Restart Service

      nginx -s reload

  nginx -s stop

  start nginx

 

Guess you like

Origin www.cnblogs.com/ihuangqing/p/11141136.html