作amp服務時,各類請求經過nginx打到resin服務器上,有個接口是抓取woff字體java
woff tff字體獲取後,提示以下錯誤,nginx
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for '
'"$upstream_addr" "$upstream_status" "$upstream_response_time" "$request_time"';web
打印出來的內容證實,同時發起的屢次請求,只有幾毫秒的upstream_response_time,而單獨訪問時則200+毫秒spring
一開始覺得是併發問題,可是量不大,並且用到了epoll服務器
因此,直接查看web.xml中的fiter,對CharacterEncodingFilter進行debug,抓取到以下異常併發
org.springframework.web.util.NestedServletException: Request processing failed;
nested exception is java.lang.IllegalStateException: Could not get HttpServletRequest URI: Illegal character in hostname at index 10: http: //amp_server:80/reventondc/amp/r/f.kinja-static.com/assets/fonts/elizabeth-serif/elizabethserif-bold-webfont.woff2?09162015app
發現是下劃線的問題,由於是測試環境,沒有用$host,直接傳過來了upstream的名稱,由於帶有下劃線,因此報錯less
後面改爲用host,問題解決測試
可是屢次請求有問題,單次請求就能夠,初步判斷是spring的小bug,回頭跟進一下,待續字體