ManagedFusion Rewriter를 역방향 프록시로 사용하고 있습니다. 구성은 매우 간단합니다.ManagedFusion Rewriter 404 후행 슬래시가없는 경우 404?
RewriteRule ^/api/(.*) http://www.example.com/api/$1 [P]
이것은 모든 URL에서 작동합니다. 그러나 URL이 이 아니며 후행 슬래시로 끝나는이 아니라면 실패합니다.
이 같은 요청은 미세 완벽하게 갈 것입니다 : GET api/report/1
2013-10-10T11:27:13 [Rewrite] Input: http://localhost:50070/api/report/1
2013-10-10T11:27:13 [Rule 0] Input: /api/report/1
2013-10-10T11:27:13 [Rule 0] Rule Pattern Matched
2013-10-10T11:27:13 [Rule 0] Output: http://www.example.com/api/report/1
2013-10-10T11:27:13 [Rewrite] Proxy: http://www.example.com/api/report/1
(the log file finishes right here)
이를 : GET api/report/
2013-10-10T11:27:11 [Rewrite] Input: http://localhost:50070/api/report/
2013-10-10T11:27:11 [Rule 0] Input: /api/report/
2013-10-10T11:27:11 [Rule 0] Rule Pattern Matched
2013-10-10T11:27:11 [Rule 0] Output: http://www.example.com/api/report/
2013-10-10T11:27:11 [Rewrite] Proxy: http://www.example.com/api/report/
2013-10-10T11:27:11 **********************************************************************************
2013-10-10T11:27:11 [Proxy] Request: http://www.example.com/api/report/
2013-10-10T11:27:12 [Proxy] System.Net.HttpWebResponse
2013-10-10T11:27:12 [Proxy] Received '200 OK'
2013-10-10T11:27:12 [Proxy] Response: http://localhost:50070/api/report/
2013-10-10T11:27:12 [Proxy] Response is being buffered
2013-10-10T11:27:12 [Proxy] Responding '200 OK'
그러나,이 같은 요청에도 프록시 URL에 대한 요청을하지 않고 404을 반환합니다 내 전체 구성 파일입니다 :
RewriteEngine On
RewriteLog "log.txt"
RewriteLogLevel 9
RewriteRule ^/api/(.*) http://www.example.com/api/$1 [P]
내가 틀릴 수도 있습니다.