![](/img/trans.png)
[英]Mixed content issue in using Application Load Balancer (ALB) in AWS
[英]VM8:1 Mixed Content issue with Ghost
我是 Ghost 新手,我剛剛在 AWS lightsail 上設置了一個 ghost 實例。 我已按照給定的指南文檔並按照文檔成功執行了所有步驟
https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-quick-start-guide-ghost
但是當我完成設置並嘗試查看 ghost 應用程序時,我遇到了許多與 HTTPS 相關的問題。
控制台錯誤在這兩種情況下都很常見,如下所示
VM8:1 Mixed Content: The page at 'https://www.<my-domain>.com/' was loaded over HTTPS, but requested an insecure resource 'http://www.<my-domain>.com/members/api/member/'. This request has been blocked; the content must be served over HTTPS.
為了解決這個問題,我運行了以下命令來更新配置文件中的 ghost URL,因為前一個是非 HTTPS。
ghost config url https://<my-domain>.com
ghost restart
現在一旦我這樣做,當我嘗試從瀏覽器將 go 重定向到我的應用程序時,它會重定向到https://127.0.0.1:2368/
這是我與URL相關的config.production.json文件內容。
有人可以幫我解決這個問題嗎? 我在這里做錯了嗎?
我能夠使用以下方法解決此問題。
添加
RequestHeader 設置 X-Forwarded-Proto "https"
到以下文件/opt/bitnami/apache2/conf/vhosts/APPNAME-https-vhost.conf
確保在 URL 更改並重新啟動后,您在 Ghost 配置 json 中的端口和 nginx/apache 配置中的代理傳遞是相同的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.