添加多个网站,使用一个域名+端口,出错了。

最新版1.10.2,运行在Arm盒子上。因为需要部署多个typecho,所以改了一点点代码,运行一切正常,其中一个实例对外暴露的是6080端口,局域网访问正常。

在网站这里,用一键部署,域名加了端口 mydomain.com:7000,监听IPv6,盒子没有外网IPv4地址。

完成添加后,这里有两个网站,一个443,一个应该7000?之前创建了一个静态页面,访问正常(443)。

设置HTTPS

然后访问:https://mydomain.com:7000,出错:

连接到 mydomain,com:7000 时发生错误。SSL 接收到一个超出最大准许长度的记录。

错误代码:SSL_ERROR_RX_RECORD_TOO_LONG
# curl -k https://mydomain.com:7000/
curl: (35) OpenSSL/3.0.11: error:0A00010B:SSL routines::wrong version number

不启用SSL访问正常

# curl -v http://mydomain.com:7000/
*   Trying [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]:7000...
* Connected to mydomain.com (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) port 7000 (#0)
> GET / HTTP/1.1
> Host: mydomain.com:7000
> User-Agent: curl/7.88.1
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: openresty
< Date: Tue, 16 Apr 2024 08:55:26 GMT
< Content-Type: text/html; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Vary: Accept-Encoding
< Host: mydomain.com
< X-Powered-By: PHP/8.2.18
< Strict-Transport-Security: max-age=31536000
< 
<!DOCTYPE HTML>
.
.
.
# curl -k -v https://mydomain.com/
*   Trying [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]:443...
* Connected to mydomain.com (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx) port 443 (#0)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=mydomain.com
*  start date: Apr 16 04:53:31 2024 GMT
*  expire date: Jul 15 04:53:30 2024 GMT
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* using HTTP/2
.
.
.

更奇怪的是原来443的静态网站的内容,变成了typecho。

请教一下,上面有什么地方做的不对?想通过域名+端口,暴露运行在机器container上的多个服务。

设置一下默认网站