Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
75b77d50
Commit
75b77d50
authored
Jun 30, 2015
by
Matt Holt
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #172 from abiosoft/fastcgi-fix
fastcgi: Fix for Issue 141: index not found, 502 Bad Gateway.
parents
b0d3a8e1
4240817a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
middleware/fastcgi/fastcgi.go
middleware/fastcgi/fastcgi.go
+7
-1
No files found.
middleware/fastcgi/fastcgi.go
View file @
75b77d50
...
...
@@ -176,7 +176,6 @@ func (h Handler) buildEnv(r *http.Request, rule Rule, fpath string) (map[string]
"CONTENT_TYPE"
:
r
.
Header
.
Get
(
"Content-Type"
),
"GATEWAY_INTERFACE"
:
"CGI/1.1"
,
"PATH_INFO"
:
pathInfo
,
"PATH_TRANSLATED"
:
filepath
.
Join
(
h
.
AbsRoot
,
pathInfo
),
// Info: http://www.oreilly.com/openbook/cgi/ch02_04.html
"QUERY_STRING"
:
r
.
URL
.
RawQuery
,
"REMOTE_ADDR"
:
ip
,
"REMOTE_HOST"
:
ip
,
// For speed, remote host lookups disabled
...
...
@@ -198,6 +197,13 @@ func (h Handler) buildEnv(r *http.Request, rule Rule, fpath string) (map[string]
"SCRIPT_NAME"
:
scriptName
,
}
// compliance with the CGI specification that PATH_TRANSLATED
// should only exist if PATH_INFO is defined.
// Info: https://www.ietf.org/rfc/rfc3875 Page 14
if
env
[
"PATH_INFO"
]
!=
""
{
env
[
"PATH_TRANSLATED"
]
=
filepath
.
Join
(
h
.
AbsRoot
,
pathInfo
)
// Info: http://www.oreilly.com/openbook/cgi/ch02_04.html
}
// Add env variables from config
for
_
,
envVar
:=
range
rule
.
EnvVars
{
env
[
envVar
[
0
]]
=
envVar
[
1
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment