1
ryd994 2016-08-07 23:12:10 +08:00 via Android
看 Nginx 的 error.log
|
2
hopewinn OP error.log 没有错误,只有 access.log 有。这是反向代理。
"POST /OddsManager/Standard?jsoncallback=jQuery111308318202934788252_1470578193061 HTTP/1.1" 400 0 "http://mml.xpj000.com/onebook?WebSkinType=2" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36 OPR/39.0.2256.48" |
3
Bardon 2016-08-07 23:24:23 +08:00
json 有多大....
默认的 nignx 配置 client_header_buffer_size 应该足够了呀 |
5
hopewinn OP 1 、源站 是 asp.net 的,自己的 client_header_buffer_size 也是 16K 的,默认是 1K ,我觉得不是这个问题。
2 、源站是正常的没有报错,直接显示网站内容,然后镜像反向代理后就一直在出现 加载状态中。 3 、从代理站上访问源站也是正常的,就唯一无法在镜像代理正常访问,真是无解。。。 |
6
ryd994 2016-08-08 09:51:14 +08:00 via Android
贴配置,看看是不是少 header 了
|
7
Senorsen 2016-08-08 17:28:36 +08:00
如果 error.log 中没有对应日志,这个 400 极有可能是上游的后端( upstream )返回的,可以看看是不是这样
代理前没问题,代理后出问题,可以用 tcpdump 抓个包,看看是不是少了头 |
8
hopewinn OP 下面是我的配置,
server { server_name mkt.xpj000.com; listen 80; location / { proxy_buffering 'off'; proxy_ignore_headers 'X-Accel-Buffering'; proxy_hide_header 'Access-Control-Allow-Origin'; proxy_hide_header 'Cache-Control'; proxy_set_header Host mkt.yuan.com proxy_pass http://mkt.yuan.com; proxy_set_header X-Real-IP '$remote_addr'; proxy_set_header X-Forwarded-For '$proxy_add_x_forwarded_for'; proxy_hide_header 'content-security-policy'; proxy_set_header Accept-Encoding ''; proxy_ignore_client_abort 'on'; proxy_set_header Accept-Language 'zh-CN'; proxy_set_header Connection 'upgrade'; if ($request_method = 'OPTIONS') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Accept'; add_header 'Access-Control-Max-Age' 1728000; add_header 'Content-Type' 'text/plain charset=UTF-8'; add_header 'Content-Length' 0; return 204; } if ($request_method = 'POST') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Accept'; } if ($request_method = 'GET') { add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Accept'; } subs_filter 'yuan.com' 'xpj000.com'; proxy_redirect ~http(.*)yuan.com(.*) http$xpj000.com$2; proxy_cookie_domain yuan.com xpj000.com; proxy_cookie_domain ~(.*)\.yuan.com $1.xpj000.com; } } 请大神们帮帮忙,谢谢了。 |
9
hopewinn OP 我顶
|