我已经尝试了多种方法来修复反向代理,但没有得到任何幸运。我遵循下面的url来解决这个问题:https://github.com/noirbizarre/flask-restplus/issues/223

nginx配置如下:
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
location /api {
proxy_pass http://localhost:5000; #change to your port
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}发布于 2020-10-08 17:37:35
向api添加重写子句
rewrite ^/api/(.*) /$1 break;https://stackoverflow.com/questions/61011763
复制相似问题