mirror of
https://github.com/koel/koel.git
synced 2026-04-25 16:56:02 +03:00
[GH-ISSUE #681] Force HTTPS URLs #485
Labels
No labels
Authentication
Dependencies
Documentation
Feature Request
Flac
Help Wanted
Installation/Setup
Integration
Mobile
PR Welcome
Pending Release
Performance
Playlist
S3
Search
Sync
[Pri] Low
[Pri] Normal
[Status] Keep Open
[Status] Needs Author Reply
[Status] Needs Review
[Status] Stale
[Status] Will Implement
[Type] Blessed
[Type] Bug
[Type] Duplicate
[Type] Enhancement
[Type] Help Request
[Type] Question
[Type] Task
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/koel-koel#485
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alex-phillips on GitHub (Nov 13, 2017).
Original GitHub issue: https://github.com/koel/koel/issues/681
I'm running koel with nginx behind CloudFlare which handles HTTPS certs for my automatically, but it basically proxies the request back to my origin server over port 80. I think koel is seeing the requests coming in over HTTP and generating all URLs as HTTP instead of HTTPS which is causing issues such as not being able to log in.
Is there a way to force koel to generate all URLs as HTTPS?
@jleonardolemos commented on GitHub (Nov 13, 2017):
@alex-phillips I think the right way is to setup https over your koel server.
Or you can try put this lines on index.php, after autoload require.
$_SERVER['SERVER_PORT'] = "443";
$_SERVER['HTTPS'] = "on";
It works for mi in another project.
@hmrodrigues commented on GitHub (Jan 12, 2018):
Hey,
So I also had this issue and fixed my adding $_SERVER['HTTPS'] = "on"; after autoload.
@phanan is it possible to add a entry into .env to force HTTPS? this way we don't need to change the php files
@mikeziri commented on GitHub (Apr 12, 2018):
that should be an .env option for sure HTTPS=false by default along with
URL::forceScheme('https'); on AppServiceProvider::boot(). with the if (env(HTTPS) === 'true')
@UmutAlihan commented on GitHub (Oct 7, 2020):
YOU ARE MY HERO!
Beacuse of your beautiful workaround, I will be able to sleep tonight 💯
@hulet commented on GitHub (Jul 27, 2023):
This can now be done by setting
FORCE_HTTPS=truein.env.@alexkutsan commented on GitHub (Jul 24, 2024):
Is there a way to support both HTTP/HTTPS?

Now I would like to use koel by HTTP in my internal tailscale network.
But when I expose it by domain name with Nginx - I would like to use https.
Right now - I can use it in the internal network by HTTPS.
But when I try to reach it by HTTPS - it fails to load because it loads many resources by HTTP, that is not allowed by the browser: