关于nginx访问接口404的问题以及https配置的问题

568 阅读1分钟

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

nginx配置,获取客户端真实的IP:

 proxy_set_header Host http_host;proxy_set_headerXRealIPhttp\_host; proxy\_set\_header X-Real-IP remote_addr;
proxy_set_header X-Forwarded-For proxy_add_x_forwarded_for;proxy_set_headerXForwardedProtoproxy\_add\_x\_forwarded\_for; proxy\_set\_header X-Forwarded-Proto scheme;