这是我的nginx
在access.log
下看/resources
转发都是200
就下面的/v2/
请求是502
这是怎么回事?
server {
listen 80;
server_name test.com;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://localhost:8080;
}
location /resources {
proxy_pass http://localhost:8080/resources;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
location ^~ /v2/ {
proxy_store off;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;
proxy_set_header Host "test.com";
proxy_pass https://api.douban.com/;
}
}
可以看下Nginx的相关日志