Skip to content

[Bug]nginx配置主应用location到二级路径导致子应用无法加载 #2856

@shier-code

Description

@shier-code

部署时nginx通过以下方式配置到服务器根路径访问,遵循entry和publicpath一致,所用应用放在同层级文件夹,可正常访问主应用和子应用

        location /{
            alias   html/qk-isptl/;
            index  index.html index.htm;
        }
        location /qk-isptl/rxfb/ {
            alias html/rxfb/;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html;
        }

生产环境受到部署限制,服务器根路径已被其他系统占用,各种原因也不允许通过根路径访问本系统,按以下方式配置,主应用能够正常通过二级路径访问,子应用无法加载,在子应用路由下刷新只会重新加载主应用静态资源并304

        location /qk-isptl {
            alias   html/qk-isptl/;
            index  index.html index.htm;
        }
        location /qk-isptl/rxfb/ {
            alias html/rxfb/;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html;
       }

#2273 该问题类似

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions