我有一个使用Docker容器化的c#Webneneneba API。我的react from end托管在HTTPS上,我从NameCheap购买了SSL证书。我的容器在http上运行,我可以通过
http://www.example.com:8080/api/messages/health
遵循此信息
https://docs.cpanel.net/ea4/apache/modify-apache-virtual-hosts-with-include-files/
,
我已经设置了一个userdata/include.conf文件如下
ServerName www.example.com
SSLEngine On
SSLCertificateFile "/var/cpanel/ssl/apache_tls/example.com/combined"
SSLCertificateKeyFile "/var/cpanel/ssl/cpanel/certificate.pem"
ProxyPreserveHost On
ProxyPass /api/ http://localhost:8080/
ProxyPassReverse /api/ http://localhost:8080/
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
我已经运行了这些命令
/usr/local/cpanel/scripts/rebuildhttpdconf
/usr/local/cpanel/scripts/restartsrv_httpd
但当我通过https调用端点时,我得到了404
https://www.example.com/api/messages/health
但在调用http时仍然得到200
http://www.example.com:8080/api/messages/health
。
这个
access.logs
不要提供任何有用的信息
[23/Jul/2023:05:43:45 +0000] "GET /api/messages/health HTTP/1.1" 404 23 "-" "PostmanRuntime/7.32.3"