Search code examples
facebookmixed-content

Experiencing the mixed content error while trying to load facebook application


I've got my application on facebook. Its working on https. Recently I've set up the apache reverse proxy. Proxy is doing redirect from https to http port 8080 of tomcat. The game is working if accessed directly. While if accessed from facebook there is an error:

Mixed Content: The page at 'https://apps.facebook.com/pennantrace/?fb_source=bookmark&ref=bookmarks&count=0&fb_bmpos=_0' was loaded over HTTPS, but requested an insecure form action 'http://thepennantrace.com/'. This request has been blocked; the content must be served over HTTPS.

UPDATE 1:

I've set spring social facebook's canvas controller's post login url to the "https://..." now it works but tomcat is redirecting the call to https://...com to the http://....com/resources/index.html

Seems like all redirects from tomcat are passed as they are (http) without changing the protocol to the https.


Solution

  • I fixed it by setting apache to use X-Forwarded-Proto And tomcat to respond on that correctly.