location ~ ^/fast-api { proxy_pass http://127.0.0.1:5000; proxy_set_header Host $proxy_host; # 改变请求头值 -> 转发到码云才会成功 proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-NginX-Proxy true; }