Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github (I've searched it).
- I agree to follow Monica's Code of Conduct.
Bug description
Mixed Content for CSS
I am running Monica CRM in a Docker container behind a reverse proxy (Nginx/CloudPanel).
My configuration:
- APP_URL is set to my public HTTPS domain (e.g. https://mydomain.tld)
- APP_ENV=production
- FORCE_HTTPS=true
- The reverse proxy sets the headers X-Forwarded-Proto https and X-Forwarded-Port 443
- Monica is running on the default port in the container, the proxy forwards all requests
Despite this, Monica generates asset links (e.g. /css/app-ltr.css?...) in the HTML as http://... instead of https://....
This results in Mixed Content errors in the browser and blocks loading of CSS/JS.
What I have already tried:
- Cleared config and view cache with php artisan config:clear, config:cache, view:clear
- Restarted the container
- Cleared browser cache
- Implemented a workaround in the proxy to redirect asset requests to HTTPS
- Verified that the headers are correctly received in the container
Actual behavior:
Assets are still generated with http://, causing Mixed Content errors.
References:
- Official Monica SSL documentation: https://github.com/monicahq/monica/blob/main/docs/installation/ssl.md
- Related Reddit thread: https://www.reddit.com/r/selfhosted/comments/wwwove/monica_crm_with_nginx_reverse_proxy/
Question:
Is there a known bug or an additional setting required so Monica generates asset links with HTTPS behind a reverse proxy?
Expected behavior
Monica should generate all asset links in the HTML with https:// when the above settings and headers are present.
Environment
Your own self-hosted instance (monica v4)
Version of Monica
4.1.2
Installation method
Docker image
Web server
Nginx
Database engine version
MySQL