#nginx location / { try_files $uri $uri/ /index.html;} ...
一 vue的所有資源修改后打包出來的名稱都會改變,所以可以使用強緩存,對css js png ttf jpg等 二 html文件因為名稱不會改變,所以使用協商緩存,html文件有改動就會立即更新,max age no cache代表進入協商緩存,文件改動會自動更新,不改動會返回 三 完整代碼 gzip壓縮 ...
2020-04-29 11:46 0 3169 推薦指數:
#nginx location / { try_files $uri $uri/ /index.html;} ...
#當你項目發布時,項目所在目錄是二級目錄,並且使用的history路由,可以采用如下配置 ##apache配置 ##如果使用nginx配置前兩步和apache配置一樣 -step3 在本地目錄下,創建conf.d文件夾,在該文件夾下創建自定義文件,文件格式是.conf ...
logs/nginx.pid; events { worker_connections ...
server { listen 80; server_name _; root /opt/h5/index/; location / { index index.html index.htm inde ...
...
vue中有兩種模式 history模式(訪問地址中包含 /#/ ),有的場景下(例如官網),訪問地址出現該路徑會比較難看,需要優化,需要切換到另外一種模式,但是nginx需要配置一下,不然刷新頁面會出現404 server {listen 8075;server_name localhost ...
1、nginx conf文件夾中nginx.conf文件: server { listen 8080; server_name localhost; error_page 500 502 503 504 /50x.html; location = /50x.html { root html ...
nginx代理vue項目, nginx的配置文件: 假如訪問52ccn.com 代理到后面的vue項目 vue項目路徑/www/website/red/admin nginx ssl證書位置在這個文件夾下面/usr/local/nginx/conf/cert/ 然后項目中接口請求統一使用 ...