我已经在GKE托管了使用nginx的角应用程序。我的位置是
location / {
root /usr/share/nginx/www;
try_files $uri $uri/ /index.html
}当我请求http://ipaddress/fieldit使用http://ipaddress/field/field加载应用程序时,如果下次刷新页面,它就不会再次加载应用程序。我在那里有一个基于用户角色的主组件,我正在对他们的默认页面进行导航。如果删除该导航,那么它只会加载类似于http://ipaddress/field/home的http://ipaddress/field和http://ipaddress/atlas/home的http://ipaddress/atlas,并且在刷新之后也不能工作。
发布于 2022-10-25 16:33:53
location / {
root /usr/share/nginx/www/ui;
index index.html index.htm silent-refresh.html;
try_files $uri $uri/ /index.html?$args;
}
location /ui/ {
root /usr/share/nginx/www/ui;
index index.html index.htm silent-refresh.html;
try_files $uri $uri/ /index.html?$args;
}这在所有场景中都适用。
https://stackoverflow.com/questions/68456075
复制相似问题