mirror of
https://github.com/pelican-dev/panel.git
synced 2026-05-04 18:00:48 +03:00
Apache2 config (.htaccess) not working with SSL-terminating reverse proxy #465
Reference in New Issue
Block a user
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 @Bungeefan on GitHub (Oct 10, 2025).
Current Behavior
Due to the rewrite rules in
.htaccess, Apache always sends a redirect for every edit file link on the "EditFiles" page (as these always end with a trailing slash), which (if using a reverse proxy and therefore HTTP) redirects to ahttp://URL, resulting in the browser not sending the session cookie and the application (incorrectly) showing the login page after the redirect.I tried every trick (
SetEnvIf,RewriteRulein vHost,RemoteIP, ...) I could find to make Apache correctly use theX-Forwarded-Protoheader from the proxy for the rewrite rule, but to absolutely no avail.Other solutions that worked:
ServerName https://<domain>): https://stackoverflow.com/a/78858892.htaccessThe rewrite rule in question:
1f56b8e114/public/.htaccess (L16-L19)The forcing of trailing slashes in EditFiles:
1f56b8e114/app/Filament/Server/Resources/Files/Pages/EditFiles.php (L279-L282)Expected Behavior
The user shouldn't be shown the login page when attempting to edit a file.
But I am unsure who is "at fault" here, the
.htaccessrule (correctly) doesn't force a protocol and Apache should probably just fix theirX-Forwarded-Protohandling.However, if using Apache is a supported configuration by this project (which it seems given the docs), I guess it should at least try to work around it/provide guidance.
X-Forwarded-Protohandling to the rule or, if possible, removing the rule.https://for the HTTP Pelican VirtualHost, if Apache is used behind a reverse-proxy.Steps to Reproduce
SESSION_SECURE_COOKIE=truePanel Version
1.0.0-beta26
Wings Version
1.0.0-beta18
Games and/or Eggs Affected
No response
Docker Image
No response
Error Logs
Is there an existing issue for this?
@Bungeefan commented on GitHub (Oct 10, 2025):
Oh sorry, I just checked Discord again (last time I checked is a few weeks ago, where I made myself a post that didn't receive any answer) and it seems that yesterday someone posted about this/a similar problem with Apache and
http://links, even withX-Forwarded-Protoheader.Thread: https://discord.com/channels/1218730176297439332/1219038617133912084/threads/1425608553481113651