8000 Assets (CSS/JS) are served over HTTP instead of HTTPS behind reverse proxy, causing Mixed Content errors · Issue #7706 · monicahq/monica · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Assets (CSS/JS) are served over HTTP instead of HTTPS behind reverse proxy, causing Mixed Content errors #7706
Open
@Stormez1998

Description

@Stormez1998

⚠️ 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:

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

Additional info

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0