Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jung-kurt committed Mar 20, 2018
1 parent d6b3c10 commit 752cfba
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ looks like this:

cgi {
match match [match2...]
except match [match2...]
exec script [args...]
env key1=val1 [key2=val2...]
pass_env key1 [key2...]
Expand All @@ -168,14 +169,20 @@ For example,

cgi {
match /sample/*.php /sample/app/*.php
except /sample/init.php
exec /usr/local/cgi-bin/phpwrap /usr/local/cgi-bin{match}
env DB=/usr/local/share/app/app.db SECRET=/usr/local/share/app/secret
pass_env HOME UID
}

With the advanced syntax, the `exec` subdirective must appear exactly once. The
`match` subdirective must appear at least once. The `env` and `pass_env`
subdirectives can appear any reasonable number of times.
`match` subdirective must appear at least once. The `env`, `pass_env`, and
`except` subdirectives can appear any reasonable number of times.

The `except` subdirective uses the same pattern matching logic that is used
with the `match` subdirective. Any request that matches a `match` pattern is
then checked with the patterns in `except`, if any. If any matches are made
with the `except` pattern, the request is rejected.

The values associated with environment variable keys are all subject to
placeholder substitution, just as with the script name and arguments.
Expand Down
11 changes: 9 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ looks like this:
cgi {
match match [match2...]
except match [match2...]
exec script [args...]
env key1=val1 [key2=val2...]
pass_env key1 [key2...]
Expand All @@ -165,14 +166,20 @@ For example,
cgi {
match /sample/*.php /sample/app/*.php
except /sample/init.php
exec /usr/local/cgi-bin/phpwrap /usr/local/cgi-bin{match}
env DB=/usr/local/share/app/app.db SECRET=/usr/local/share/app/secret
pass_env HOME UID
}
With the advanced syntax, the exec subdirective must appear exactly once. The
match subdirective must appear at least once. The env and pass_env
subdirectives can appear any reasonable number of times.
match subdirective must appear at least once. The env, pass_env, and
except subdirectives can appear any reasonable number of times.
The except subdirective uses the same pattern matching logic that is used
with the match subdirective. Any request that matches a match pattern is
then checked with the patterns in except, if any. If any matches are made
with the except pattern, the request is rejected.
The values associated with environment variable keys are all subject to
placeholder substitution, just as with the script name and arguments.
Expand Down
8 changes: 4 additions & 4 deletions doc/cgi.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ This method facilitates the use of CGI on the Windows platform.
### Advanced Syntax

In order to specify custom environment variables, pass along one or more
environment variables known to Caddy, specify more than one match pattern for a
given rule, or exclude certain matches, you will need to use the advanced
directive syntax. That looks like this:
environment variables known to Caddy, or specify more than one match pattern
for a given rule, you will need to use the advanced directive syntax. That
looks like this:

> %syntax%
> [cgi][key] {
Expand Down Expand Up @@ -517,4 +517,4 @@ at sample/min.php:
[php]: http://php.net/
[report]: https://goreportcard.com/report/github.com/jung-kurt/caddy-cgi
[subkey]: class:subkey
[travis]: https://travis-ci.org/jung-kurt/caddy-cgi
[travis]: https://travis-ci.org/jung-kurt/caddy-cgi
12 changes: 10 additions & 2 deletions doc/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,15 @@ looks like this:
> %syntax%
> [cgi][key] {
> [match][key] [match [match2...]][subkey]
> [except][key] [match [match2...]][subkey]
> [exec][key] [script [args...]][subkey]
> [env][key] [key1=val1 [key2=val2...]][subkey]
> [pass_env][key] [key1 [key2...]][subkey]
> }
~rg~
cgi {
match match [match2...]
except match [match2...]
exec script [args...]
env key1=val1 [key2=val2...]
pass_env key1 [key2...]
Expand All @@ -208,14 +210,20 @@ For example,

cgi {
match /sample/*.php /sample/app/*.php
except /sample/init.php
exec /usr/local/cgi-bin/phpwrap /usr/local/cgi-bin{match}
env DB=/usr/local/share/app/app.db SECRET=/usr/local/share/app/secret
pass_env HOME UID
}

With the advanced syntax, the `exec` subdirective must appear exactly once. The
`match` subdirective must appear at least once. The `env` and `pass_env`
subdirectives can appear any reasonable number of times.
`match` subdirective must appear at least once. The `env`, `pass_env`, and
`except` subdirectives can appear any reasonable number of times.

The `except` subdirective uses the same pattern matching logic that is used
with the `match` subdirective. Any request that matches a `match` pattern is
then checked with the patterns in `except`, if any. If any matches are made
with the `except` pattern, the request is rejected.

The values associated with environment variable keys are all subject to
placeholder substitution, just as with the script name and arguments.
Expand Down

0 comments on commit 752cfba

Please sign in to comment.