SSL Termination causing issues fetching content
henriquevcosta opened this issue · 3 comments
I have Monica running in a docker container with a Traefik container performing the SSL termination. Assume my domain is potato.com in the description below.
- I have configured Monica's container with the Traefik rule to use the hostname "monica.potato.com". Traefik will do HTTPs and then hit Monica's container on :80
- If I hit
https://monica.potato.com
I am redirected to the dashboard page, and am able to create the first user. However, the style's all broken and the form submission generates a browser warning saying it's unsafe - Opening the browser console shows that a few resources (JS and CSS) have been blocked because they are trying to be fetched from
http://monica.potato.com
and indeed if I open the source of the dashboard page I see the below
<link rel="stylesheet" href="http://monica.potato.com/css/app-ltr.css?id=523470c277b241ddce13">
Is there something else that needs to be configured in the container for this to work well? Maybe something that lets apache know that although what's reaching it is an http request it should use https URLs?
I don't think it makes sense to be doing body rewrites in Traefik to address this, but I'm very ignorant of PHP+Apache so I have no idea what I'd need to get this working.
Happy to provide more info if needed.
OK after setting some env variables it seems to work, maybe they need to be in the documentation.
I set:
- APP_URL to my external URL (https://monica.potato.com)
- APP_ENV to "production"
- APP_FORCE_URL to "true"
Hope this helps others
Only setting APP_ENV to "production"
works for me.
Closing this one now, thank you.