uniapp H5 history模式 nginx伪静态

1,345 阅读1分钟

  location / {
        add_header 'Access-Control-Allow-Origin' '*'; 
        try_files $uri $uri/ @router
        index  index.html index.htm;
    }
    location @router {
        rewrite ^.*$ /index.html last;
    }
     if (!-e $request_filename) {
        rewrite ^/(.*) /index.html last;
        break;
    }