Mis-redirection when setting customized http port

Issue #1072 duplicate
Hana created an issue

I need to setup other web services on my vps, so I configure my docker instant (the latest version 2.4.5) with arguments “HTTPS=OFF“ and “HTTP_PORT=8080“, and reverse proxied by caddy with “reverse_proxy 127.0.0.1:8080“. In most of cases, it worked fine.

But it gets an wired status when requesting “https://mail.mysite.com/admin“ and “https://mail.mysite.com/webmail“ (without a trailing slash) :

the web server reports a 302 respond to https://mail.mysite.com:8080/admin/ or https://mail.mysite.com:8080/webmail/, instead of the correct ones such as https://mail.mysite.com/admin/.

As a consequence, the pages will not loading correctly incase I correct the url to trailing slash ones ( “https://mail.mysite.com/admin/“) manually.

cCUL responds below:

curl -vv https://mail.xxxx.com/admin
******** omitted cert exchange  ****
* [HTTP/2] [1] OPENED stream for https://mail.xxxx.com/admin
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: mail.xxxx.com]
* [HTTP/2] [1] [:path: /admin]
* [HTTP/2] [1] [user-agent: curl/8.6.0]
* [HTTP/2] [1] [accept: */*]
> GET /admin HTTP/2
> Host: mail.xxxx.com
> User-Agent: curl/8.6.0
> Accept: */*
>
< HTTP/2 301
< alt-svc: h3=":443"; ma=2592000
< content-type: text/html
< date: Sat, 15 Jun 2024 15:06:50 GMT
< location: http://mail.xxxx.com:8080/admin/
< content-length: 162
<
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
* Connection #0 to host x.x.x.x left intact

Comments (1)

  1. Log in to comment