一般来说,nginx配置了静态资源和接口代理后,如果nginx服务器的localhost可以正常访问,那几本没有啥问题了,本次我是localhost可以正常访问,但是ip+端口访问接口就报404的错误了,localhost访问就正常,接口也正常。

nginx配置,获取客户端真实的IP:
proxy_set_header Host http_host;proxy_set_headerX−Real−IPremote_addr;
proxy_set_header X-Forwarded-For proxy_add_x_forwarded_for;proxy_set_headerX−Forwarded−Protoscheme;