diff --git a/middleware/fastcgi/fastcgi.go b/middleware/fastcgi/fastcgi.go old mode 100644 new mode 100755 index cdb8e91f..5dd262ff --- a/middleware/fastcgi/fastcgi.go +++ b/middleware/fastcgi/fastcgi.go @@ -166,6 +166,9 @@ func (h Handler) buildEnv(r *http.Request, rule Rule, fpath string) (map[string] scriptFilename = absPath } + // Strip PATH_INFO from SCRIPT_NAME + scriptName = strings.TrimSuffix(scriptName, pathInfo) + // Get the request URI. The request URI might be as it came in over the wire, // or it might have been rewritten internally by the rewrite middleware (see issue #256). // If it was rewritten, there will be a header indicating the original URL, diff --git a/middleware/fastcgi/fcgiclient.go b/middleware/fastcgi/fcgiclient.go index b657a3b3..91f8cb87 100644 --- a/middleware/fastcgi/fcgiclient.go +++ b/middleware/fastcgi/fcgiclient.go @@ -381,9 +381,9 @@ func (c *FCGIClient) Request(p map[string]string, req io.Reader) (resp *http.Res return } if len(statusParts) > 1 { - resp.Status = statusParts[1] + resp.Status = statusParts[1] } - + } else { resp.StatusCode = http.StatusOK }