我正在将 nginx 用于我的 FARM 堆栈应用程序。我遇到了一个问题,我的 API 不通过 HTTPS,但它在 HTTP 上运行。我尝试删除服务器 80 块仍然遇到同样的问题。
这是错误
docker-fastapi | [2021-04-10 01:02:36 +0000] [9] [WARNING] Invalid HTTP request received. proxy-app | 2021/04/10 01:02:36 [error] 22#22: *15 peer closed connection in SSL handshake while SSL handshaking to upstream, client: 192.168.249.11, server: xxxx, request: "GET /api/ HTTP/1.1", upstream: "https://192.168.160.2:8080/api/", host: "xxx"
Run Code Online (Sandbox Code Playgroud)
这是 nginxconf 文件
upstream docker_fastapi {
server docker-fastapi:8080;
}
server {
listen 80;
location ~ /api/ {
proxy_pass http://docker_fastapi;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header …Run Code Online (Sandbox Code Playgroud)