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

Commit 752cfba

Browse files
committed
Update documentation
1 parent d6b3c10 commit 752cfba

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ looks like this:
159159

160160
cgi {
161161
match match [match2...]
162+
except match [match2...]
162163
exec script [args...]
163164
env key1=val1 [key2=val2...]
164165
pass_env key1 [key2...]
@@ -168,14 +169,20 @@ For example,
168169

169170
cgi {
170171
match /sample/*.php /sample/app/*.php
172+
except /sample/init.php
171173
exec /usr/local/cgi-bin/phpwrap /usr/local/cgi-bin{match}
172174
env DB=/usr/local/share/app/app.db SECRET=/usr/local/share/app/secret
173175
pass_env HOME UID
174176
}
175177

176178
With the advanced syntax, the `exec` subdirective must appear exactly once. The
177-
`match` subdirective must appear at least once. The `env` and `pass_env`
178-
subdirectives can appear any reasonable number of times.
179+
`match` subdirective must appear at least once. The `env`, `pass_env`, and
180+
`except` subdirectives can appear any reasonable number of times.
181+
182+
The `except` subdirective uses the same pattern matching logic that is used
183+
with the `match` subdirective. Any request that matches a `match` pattern is
184+
then checked with the patterns in `except`, if any. If any matches are made
185+
with the `except` pattern, the request is rejected.
179186

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

doc.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ looks like this:
156156
157157
cgi {
158158
match match [match2...]
159+
except match [match2...]
159160
exec script [args...]
160161
env key1=val1 [key2=val2...]
161162
pass_env key1 [key2...]
@@ -165,14 +166,20 @@ For example,
165166
166167
cgi {
167168
match /sample/*.php /sample/app/*.php
169+
except /sample/init.php
168170
exec /usr/local/cgi-bin/phpwrap /usr/local/cgi-bin{match}
169171
env DB=/usr/local/share/app/app.db SECRET=/usr/local/share/app/secret
170172
pass_env HOME UID
171173
}
172174
173175
With the advanced syntax, the exec subdirective must appear exactly once. The
174-
match subdirective must appear at least once. The env and pass_env
175-
subdirectives can appear any reasonable number of times.
176+
match subdirective must appear at least once. The env, pass_env, and
177+
except subdirectives can appear any reasonable number of times.
178+
179+
The except subdirective uses the same pattern matching logic that is used
180+
with the match subdirective. Any request that matches a match pattern is
181+
then checked with the patterns in except, if any. If any matches are made
182+
with the except pattern, the request is rejected.
176183
177184
The values associated with environment variable keys are all subject to
178185
placeholder substitution, just as with the script name and arguments.

doc/cgi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ This method facilitates the use of CGI on the Windows platform.
155155
### Advanced Syntax
156156

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

162162
> %syntax%
163163
> [cgi][key] {
@@ -517,4 +517,4 @@ at sample/min.php:
517517
[php]: http://php.net/
518518
[report]: https://goreportcard.com/report/github.com/jung-kurt/caddy-cgi
519519
[subkey]: class:subkey
520-
[travis]: https://travis-ci.org/jung-kurt/caddy-cgi
520+
[travis]: https://travis-ci.org/jung-kurt/caddy-cgi

doc/doc.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,15 @@ looks like this:
191191
> %syntax%
192192
> [cgi][key] {
193193
> [match][key] [match [match2...]][subkey]
194+
> [except][key] [match [match2...]][subkey]
194195
> [exec][key] [script [args...]][subkey]
195196
> [env][key] [key1=val1 [key2=val2...]][subkey]
196197
> [pass_env][key] [key1 [key2...]][subkey]
197198
> }
198199
~rg~
199200
cgi {
200201
match match [match2...]
202+
except match [match2...]
201203
exec script [args...]
202204
env key1=val1 [key2=val2...]
203205
pass_env key1 [key2...]
@@ -208,14 +210,20 @@ For example,
208210

209211
cgi {
210212
match /sample/*.php /sample/app/*.php
213+
except /sample/init.php
211214
exec /usr/local/cgi-bin/phpwrap /usr/local/cgi-bin{match}
212215
env DB=/usr/local/share/app/app.db SECRET=/usr/local/share/app/secret
213216
pass_env HOME UID
214217
}
215218

216219
With the advanced syntax, the `exec` subdirective must appear exactly once. The
217-
`match` subdirective must appear at least once. The `env` and `pass_env`
218-
subdirectives can appear any reasonable number of times.
220+
`match` subdirective must appear at least once. The `env`, `pass_env`, and
221+
`except` subdirectives can appear any reasonable number of times.
222+
223+
The `except` subdirective uses the same pattern matching logic that is used
224+
with the `match` subdirective. Any request that matches a `match` pattern is
225+
then checked with the patterns in `except`, if any. If any matches are made
226+
with the `except` pattern, the request is rejected.
219227

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

0 commit comments

Comments
 (0)