Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL not working, wrong schema detected #7120

Closed
3 tasks done
brucealdridge opened this issue Jan 15, 2024 · 4 comments
Closed
3 tasks done

SSL not working, wrong schema detected #7120

brucealdridge opened this issue Jan 15, 2024 · 4 comments
Labels

Comments

@brucealdridge
Copy link

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

Laravel incorrectly assumes scheme to be http

Steps to reproduce

  1. Using cloudflare or traefik to proxy access to monica via SSL
  2. Set url in APP_URL env var with https:// scheme
  3. Visit monica url
  4. See all links as http://
    ...
Screenshot 2024-01-15 at 3 33 37 PM

Screenshot 2024-01-15 at 3 32 19 PM

Expected behavior

Expect the http/s scheme to be detected correctly, or have an option to define the scheme.

Environment

Your own self-hosted instance (v5 a.k.a chandler version or main branch)

Version of Monica

a6bf781

Installation method

Docker image

Web server

Apache

Database engine version

SQlite

Additional info

No response

@MouettE-SC
Copy link

Did you try to set the variable ASSET_URL in .env with the https link ?

@brucealdridge
Copy link
Author

Setting that fixed js/css assets but login fails due to the still incorrect url set to the Ziggy config.

<script type="text/javascript">
    const Ziggy = {"url":"http:\/\/......,

@MouettE-SC
Copy link

MouettE-SC commented Jan 29, 2024

OK setting up APP_TRUSTED_PROXIES=* in .env should fix it (you can drop the ASSET_URL as it should not be needed anymore). Refer to https://laravel.com/docs/10.x/requests#configuring-trusted-proxies for more information

@brucealdridge
Copy link
Author

That worked great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants