今天公司產品一個功能突然掛掉了。。。向客戶演示之前出現了,手機端顯示不能獲取下載資源,可是急壞了一票人。。
通過手機端,調查服務器地址調用了http:/2342342.domain.hostname.cn/apis/stickydataurls/接口,服務器返回502和500錯誤,去查看服務器前端Nginx錯誤日志顯示:
2014/08/13 16:11:00 [error] 23851#0: *10303771 connect() failed (111: Connection refused) while connecting to upstream, client: 12.12.12.12, server: *.domain.hostname.cn, request: "POST /apis/pl/getStickGoInfo HTTP/1.0", upstream: "http://10.8.1.10:8080/apis/pl/getStickGoInfo", host: "00e06f26db47.domain.hostname.cn"
.........................
2014/08/13 16:21:48 [error] 24149#0: *9354 invalid URL prefix in "http://", client: 14.205.27.34, server: *.domain.hostname.cn, request: "GET / HTTP/1.1", host: "123456789012.domain.hostname.cn" 2014/08/13 16:21:49 [error] 24149#0: *9363 invalid URL prefix in "http://", client: 14.205.27.34, server: *.domain.hostname.cn, request: "GET / HTTP/1.1", host: "123456789012.domain.hostname.cn", request: "GET /favicon.ico HTTP/1.1", host: "123456789012.domain.hostname.cn" 2014/08/13 16:21:49 [error] 24149#0: *9365 invalid URL prefix in "http://", client: 14.205.27.34, server: *.domain.hostname.cn, request: "GET / HTTP/1.1", host: "123456789012.s.234g.cn", request: "GET /favicon.ico HTTP/1.1", host: "123456789012.domain.hostname.cn" 2014/08/13 16:25:32 [error] 24151#0: *12008 directory index of "/var/www/" is forbidden, client: 36.103.170.240, server: host, request: "GET / HTTP/1.0", host: host
這個時候再去看Nginx配置,也沒有錯。對於路徑/ 和/apis/stickydataurls/都有重定向,
server_name *.domain.hostname.cn; location /{ ................ } location = /apis/stickydataurls/ { include /etc/nginx/conf.d/PhyLink; proxy_pass http://do.host.cn/apis/pl/getStickGoInfo; }
但是訪問一直出現問題。
再去查看日志,發現最早的日志,出現了不應該出現的8080端口,這個端口是在 location / 分支才應該出現的,但是在這個配置里邊,出現這個情況是完全不能理解的,手機端調用/apis/stickydataurls/應該進入do.host.cn域下的/apis/pl/getStickGoInfo。而不應該出現10.8.1.10:8080/apis/pl/getStickGoInfo。
