diff options
Diffstat (limited to 'doc/vmod-dbrw.3')
-rw-r--r-- | doc/vmod-dbrw.3 | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/doc/vmod-dbrw.3 b/doc/vmod-dbrw.3 index 2abef65..9bec008 100644 --- a/doc/vmod-dbrw.3 +++ b/doc/vmod-dbrw.3 | |||
@@ -10,13 +10,13 @@ | |||
10 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | .\" GNU General Public License for more details. | 12 | .\" GNU General Public License for more details. |
13 | .\" | 13 | .\" |
14 | .\" You should have received a copy of the GNU General Public License | 14 | .\" You should have received a copy of the GNU General Public License |
15 | .\" along with vmod-dbrw. If not, see <http://www.gnu.org/licenses/>. | 15 | .\" along with vmod-dbrw. If not, see <http://www.gnu.org/licenses/>. |
16 | .TH VMOD-DBRW 3 "December 8, 2018" "VMOD-DBRW" "User Reference" | 16 | .TH VMOD-DBRW 3 "February 13, 2019" "VMOD-DBRW" "User Reference" |
17 | .SH NAME | 17 | .SH NAME |
18 | vmod-dbrw \- Database-driven rewrite rules for Varnish Cache | 18 | vmod-dbrw \- Database-driven rewrite rules for Varnish Cache |
19 | .SH SYNOPSIS | 19 | .SH SYNOPSIS |
20 | .B import dbrw; | 20 | .B import dbrw; |
21 | .PP | 21 | .PP |
22 | .BI "VOID dbrw.config(STRING " dbtype ", STRING " params ", STRING " query ");" | 22 | .BI "VOID dbrw.config(STRING " dbtype ", STRING " params ", STRING " query ");" |
@@ -187,29 +187,49 @@ modify regular expression handling. The following flags are defined: | |||
187 | .BR NC " or " nocase | 187 | .BR NC " or " nocase |
188 | Treat \fBregexp\fR as case-insensitive. | 188 | Treat \fBregexp\fR as case-insensitive. |
189 | .TP | 189 | .TP |
190 | .B case | 190 | .B case |
191 | Treat \fBregexp\fR as case-sensitive (default). | 191 | Treat \fBregexp\fR as case-sensitive (default). |
192 | .TP | 192 | .TP |
193 | .B eq | ||
194 | Use exact string matching. | ||
195 | .TP | ||
193 | .BR QSA " or " qsappend | 196 | .BR QSA " or " qsappend |
194 | Treat the resulting value as URL; append any query string from the | 197 | Treat the resulting value as URL; append any query string from the |
195 | original \fBvalue\fR to it. | 198 | original \fBvalue\fR to it. |
196 | .TP | 199 | .TP |
197 | .BR QSD " or " qsdiscard | 200 | .BR QSD " or " qsdiscard |
198 | Treat the resulting value as URL; discard any query string attached to | 201 | Treat the resulting value as URL; discard any query string attached to |
199 | the original \fBvalue\fR. | 202 | the original \fBvalue\fR. |
200 | .TP | 203 | .TP |
201 | \fBredirect=\fICODE\fR or \fBR=\fICODE\fR | 204 | \fBredirect=\fICODE\fR or \fBR=\fICODE\fR |
202 | On success, set the \fBX\-VMOD\-DBRW\-Status\fR header to \fICODE\fR, | 205 | On success, set the \fBX\-VMOD\-DBRW\-Status\fR header to \fICODE\fR, |
203 | which must be a valid HTTP status code. | 206 | which must be a valid HTTP status code. |
207 | .TP | ||
208 | .B regex | ||
209 | Use regular expression matching. This is the default. This flag is | ||
210 | provided for completeness sake, as a counterpart of | ||
211 | .BR eq . | ||
204 | .PP | 212 | .PP |
205 | If \fBregexp\fR or \fBvalue\fR is NULL, the tuple is handled as | 213 | If \fBregexp\fR or \fBvalue\fR is NULL, the tuple is handled as |
206 | described in | 214 | described in |
207 | .BR "Strict matches" . | 215 | .BR "Strict matches" . |
208 | .PP | 216 | .PP |
209 | If \fBflags\fR is NULL, it is ignored. | 217 | If \fBflags\fR is NULL, it is ignored. |
218 | .SH HTTP HEADERS | ||
219 | Upon return, | ||
220 | .B dbrw.return | ||
221 | may set one of the following headers in | ||
222 | .BR resp.http : | ||
223 | .TP | ||
224 | .B X\-VMOD\-DBRW\-Status | ||
225 | If the \fBredirect\fR flag was used, this header contains the HTTP | ||
226 | response code to be used instead of the default. | ||
227 | .TP | ||
228 | .B X\-VMOD\-DBRW\-Error | ||
229 | This header is set to \fB1\fR if an error occurred during the rewrite. | ||
210 | .SH EXAMPLES | 230 | .SH EXAMPLES |
211 | The examples in this section assume \fBMySQL\fR databases. Any | 231 | The examples in this section assume \fBMySQL\fR databases. Any |
212 | details not related to \fBvmod-dbrw\fR are omitted. | 232 | details not related to \fBvmod-dbrw\fR are omitted. |
213 | .SS Redirects | 233 | .SS Redirects |
214 | .PP | 234 | .PP |
215 | This example shows how to implement apache-style permanent redirects | 235 | This example shows how to implement apache-style permanent redirects |