如何为子目录中的 Angular 应用程序启用 SSL?

How to enable SSL for Angular App in subdirectory?

我已将 Angular 应用程序部署到子目录 www.mywebsite.com/my-app-here

当用户输入 www.mywebsite.com 时,我看到绿色锁,因为此处启用了 SSL。但是当用户输入或导航到 /my-app-here 时,锁就会消失并且页面“不安全”。

舰长剑八回答:

SSL is already enabled for your subdirectory. You just have to enforce it by redirecting all HTTP traffic to HTTPS. This is done in various ways depending on the hosting environment and platform the applications are built on.

我只需要将所有 http-requests 重定向到特定路由的 https-request。 (我最终重定向了所有路线)。