我一直在使用 Google Cloud IAP 来保护我在https://some-domain下的网络应用。但是,我在使用 nginx + 静态 SPA 访问 Cloud IAP 特殊 url 时发现了一个问题。我发现如果我没有登录,我可以访问以下指定的特殊 url:https ://cloud.google.com/iap/docs/special-urls-howto 。https://some-domain/_gcp_iap/identity
因此,如果我没有登录,我可以轻松访问诸如此类的端点。
但是,在我登录后,我无法再访问特殊的 url ( /_gcp_iap/*
) 并被重定向到 SPA 错误页面。我注意到我的 nginx 配置中有这个:
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html?/$request_uri;
}
这是 nginx 配置导致的问题吗?我该如何解决这个问题?
更新:根本原因是由于 3xx 重定向的服务工作者行为(通常发生在登录/身份验证期间)。是否可以让服务人员与 IAP 一起工作?
谢谢你。