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

$_SERVER['HTTPS'] is set to https when actually not enabled #1240

Open
hookenz opened this issue Dec 10, 2024 · 1 comment
Open

$_SERVER['HTTPS'] is set to https when actually not enabled #1240

hookenz opened this issue Dec 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@hookenz
Copy link

hookenz commented Dec 10, 2024

What happened?

I've got a little project that bundles frankenphp and my little app in a container with phpliteadmin.
It seems to be redirecting to https based on the fact that $_SERVER['HTTPS'] = https. Only it shouldn't.

The server config doesn't have an https entry

Build Type

Docker (Debian Bookworm)

Worker Mode

Yes

Operating System

GNU/Linux

CPU Architecture

x86_64

PHP configuration

It's very standard.

Relevant log output

{"remote_ip":"172.19.0.1","remote_port":"49050","client_ip":"172.19.0.1","proto":"HTTP/1.1","method":"GET","host":"localhost:8080","uri":"/phpliteadmin/phpliteadmin.php?database=%2Fapp%2Fwww%2Fdata%2Fserverkit.db&fulltexts=0&numRows=30&logout=Logout","headers":{"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-User":["?1"],"Sec-Ch-Ua-Platform":["\"Windows\""],"Upgrade-Insecure-Requests":["1"],"Sec-Fetch-Site":["same-origin"],"Sec-Fetch-Dest":["document"],"Accept-Language":["en-GB,en-US;q=0.9,en;q=0.8"],"Cookie":["REDACTED"],"Sec-Ch-Ua-Mobile":["?0"],"Dnt":["1"],"Accept-Encoding":["gzip, deflate, br, zstd"],"Connection":["keep-alive"],"Cache-Control":["max-age=0"],"Sec-Ch-Ua":["\"Google Chrome\";v=\"131\", \"Chromium\";v=\"131\", \"Not_A Brand\";v=\"24\""],"User-Agent":["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"],"Referer":["http://localhost:8080/phpliteadmin/phpliteadmin.php"]}},"bytes_read":0,"user_id":"","duration":0.213355849,"size":778,"status":200,"resp_headers":{"Server":["Caddy"],"Set-Cookie":["REDACTED"],"Expires":["Thu, 19 Nov 1981 08:52:00 GMT"],"Cache-Control":["no-store, no-cache, must-revalidate"],"Pragma":["no-cache"],"Content-Type":["text/html; charset=utf-8"],"Content-Encoding":["zstd"],"Vary":["Accept-Encoding"]}}

...

>>>> {"level":"info","ts":1733872342.5892186,"msg":"PROTOCOL: https","syslog_level":"notice"} <<<<

FROM an inserted : error_log("PROTOCOL: ".$protocol); 
that I added in phpliteadmin.php.

...

{"level":"info","ts":1733872342.5899868,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_ip":"172.19.0.1","remote_port":"49050","client_ip":"172.19.0.1","proto":"HTTP/1.1","method":"POST","host":"localhost:8080","uri":"/phpliteadmin/phpliteadmin.php?","headers":{"Content-Length":["114"],"Cache-Control":["max-age=0"],"Sec-Ch-Ua-Mobile":["?0"],"Sec-Fetch-Site":["same-origin"],"Sec-Fetch-User":["?1"],"Connection":["keep-alive"],"Upgrade-Insecure-Requests":["1"],"Accept":
@hookenz hookenz added the bug Something isn't working label Dec 10, 2024
@AlliBalliBaba
Copy link
Collaborator

Can you also share your Caddyfile? I think you have to eplicitly set an http port for the server or disable https, otherwise it will redirect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants