How to reverse_proxy tengine site

1. The problem I’m having:

I can’t reverse_proxy this site http://typhoon.nmc.cn/web.html

2. Error messages and/or full log output:

{"upstream": "typhoon.nmc.cn:80", "duration": 11.0931018, "request": {"remote_ip": "127.0.0.1", "remote_port": "37518", "client_ip": "127.0.0.1", "proto": "HTTP/1.1", "method": "GET", "host": "typhoon.nmc.cn:80", "uri": "/web.html", "headers": {"X-Forwarded-Host": ["127.0.0.1"], "User-Agent": ["Mozilla/5.0 (Windows NT; Windows NT 10.0; zh-CN) WindowsPowerShell/5.1.19041.4522"], "X-Forwarded-For": ["127.0.0.1"], "X-Forwarded-Proto": ["http"]}}, "headers": {"Server": ["Tengine"], "Date": ["Fri, 14 Jun 2024 00:35:00 GMT"], "Content-Type": ["text/html"], "Content-Length": ["609"], "Set-Cookie": ["REDACTED"]}, "status": 500}

3. Caddy version:

v2.8.4 h1:q3pe0wpBj1OcHFZ3n/1nl4V4bxBrYoSoab7rL9BMYNk=

4. How I installed and ran Caddy:

a. System environment:

Windows10, x64

b. Command:

.\caddy.exe run

c. Service/unit/compose file:

d. My complete Caddy config:

{
	debug
}

:80 {
	# tls ./certs/1.pem ./certs/1.key
	encode zstd gzip
	reverse_proxy http://typhoon.nmc.cn {
		header_up Host {upstream_hostport}
		transport http {
			dial_timeout 20s
		}
	}
}

5. Links to relevant resources:

http://typhoon.nmc.cn/web.html

There’s not enough information here for us to help. Please post you full logs, not just one line. Show an example request with curl -v. Please explain the problem in more detail. Please completely fill out the help topic template as per the forum rules.

I see that the log has "status": 500, that suggests a problem with the upstream app. That’s not something we can help you with, you’ll need to get help from the upstream app or look at the logs to understand why it happens.

1 Like
curl -vL http://127.0.0.1/web.html
*   Trying 127.0.0.1:80...
* Connected to 127.0.0.1 (127.0.0.1) port 80
> GET /web.html HTTP/1.1
> Host: 127.0.0.1
> User-Agent: curl/8.6.0
> Accept: */*
> 
< HTTP/1.1 500 Internal Server Error
< Content-Length: 609
< Content-Type: text/html
< Date: Sat, 15 Jun 2024 03:47:19 GMT
< Server: Caddy
< Server: Tengine
< Set-Cookie: ray_leech_token=1718423240; path=/
< 
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<a href=/_ascnlink_k></a>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
 Sorry for the inconvenience.<br/>
Please report this message and include the following information to us.<br/>
Thank you very much!</p>
<table>
<tr>
<td>URL:</td>
<td>http://typhoon.nmc.cn/web.html</td>
</tr>
<tr>
<td>Server:</td>
<td>web223</td>
</tr>
<tr>
<td>Date:</td>
<td>2024/06/15 11:47:19</td>
</tr>
</table>
<hr/>Powered by Tengine<hr><center>tengine</center>
</body>
</html>
* Connection #0 to host 127.0.0.1 left intact

This is the log information, I don’t have the upstream information, but the nginx reverse proxy is ok

:man_shrugging:

The problem could be anything, we don’t have enough information to help here. You’ll have to get in contact with whoever runs that server to explain why their server responds that way.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.