鍍金池/ 問(wèn)答/Linux  網(wǎng)絡(luò)安全  HTML/ vue開(kāi)發(fā)的單頁(yè)應(yīng)用(開(kāi)發(fā)中實(shí)現(xiàn)子路由打開(kāi)新標(biāo)簽),發(fā)布到nginx后 子路由在

vue開(kāi)發(fā)的單頁(yè)應(yīng)用(開(kāi)發(fā)中實(shí)現(xiàn)子路由打開(kāi)新標(biāo)簽),發(fā)布到nginx后 子路由在新標(biāo)簽打開(kāi),顯示404

vue開(kāi)發(fā)的單頁(yè)應(yīng)用(開(kāi)發(fā)中實(shí)現(xiàn)打開(kāi)子路由在新標(biāo)簽顯示) 發(fā)布放到nginx里,子路由在新標(biāo)簽打開(kāi),顯示404

clipboard.png

nginx.conf


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

server {
        listen       8086;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html/msh;
            index  index.html index.htm;
        }
        location /msh/screen/syn-map {
            root   html/msh;
            index  index.html index.htm;
        }
       }
     //...**加粗文字**
     }
回答
編輯回答
硬扛

不知道你是不是少了//

:href="`//${host}${route.path}`"
2018年5月29日 01:11
編輯回答
硬扛
location / {
  try_files $uri $uri/ /index.html;
}

nginx加上這個(gè)??茨愕膗rl,你的路由是開(kāi)啟了history模式。
具體請(qǐng)看History模式

2018年6月4日 01:31