vue部署訪問單頁面404問題

vue單頁面的啓動頁面是index.html,路由的路徑實際是不存在的,所以會出現訪問單頁面404問題,需要設置所有找不到的路徑直接映射到index.html

		root D:/nginx-0.8.55/html/dist/;
		index  index.html index.htm;
		
        location / {
			try_files $uri $uri @router;
			index index.html;
        }
		
		location @router {
			rewrite ^.*$ /index.html last;
		}
		location /api/ {
			proxy_pass http://192.168.8.133:8090/api/;
		}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章