@enjoys/context-engine 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1589 @@
1
+ {
2
+ "language": "caddy",
3
+ "completions": [
4
+ {
5
+ "label": "site block",
6
+ "kind": 15,
7
+ "detail": "Basic site block",
8
+ "documentation": {
9
+ "value": "A Caddyfile site block with an address.\n\n```caddyfile\nexample.com {\n # directives\n}\n```"
10
+ },
11
+ "insertText": "${1:example.com} {\n\t$0\n}",
12
+ "insertTextRules": 4,
13
+ "sortText": "00_site_block"
14
+ },
15
+ {
16
+ "label": "site block with port",
17
+ "kind": 15,
18
+ "detail": "Site block with custom port",
19
+ "documentation": {
20
+ "value": "A site block listening on a specific port.\n\n```caddyfile\n:8080 {\n respond \"Hello\"\n}\n```"
21
+ },
22
+ "insertText": ":${1:8080} {\n\t$0\n}",
23
+ "insertTextRules": 4,
24
+ "sortText": "00_site_block_with_port"
25
+ },
26
+ {
27
+ "label": "wildcard site",
28
+ "kind": 15,
29
+ "detail": "Wildcard site block",
30
+ "documentation": {
31
+ "value": "Match all subdomains with a wildcard.\n\n```caddyfile\n*.example.com {\n tls {\n dns cloudflare {env.CF_API_TOKEN}\n }\n}\n```"
32
+ },
33
+ "insertText": "*.${1:example.com} {\n\t$0\n}",
34
+ "insertTextRules": 4,
35
+ "sortText": "00_wildcard_site"
36
+ },
37
+ {
38
+ "label": "site with multiple addresses",
39
+ "kind": 15,
40
+ "detail": "Multi-address site block",
41
+ "documentation": {
42
+ "value": "Serve multiple domains from one block.\n\n```caddyfile\nexample.com www.example.com {\n respond \"Hello\"\n}\n```"
43
+ },
44
+ "insertText": "${1:example.com} ${2:www.example.com} {\n\t$0\n}",
45
+ "insertTextRules": 4,
46
+ "sortText": "00_site_with_multiple_addresses"
47
+ },
48
+ {
49
+ "label": "https site",
50
+ "kind": 15,
51
+ "detail": "HTTPS site block",
52
+ "documentation": {
53
+ "value": "Explicit HTTPS site block.\n\n```caddyfile\nhttps://example.com {\n respond \"Secure!\"\n}\n```"
54
+ },
55
+ "insertText": "https://${1:example.com} {\n\t$0\n}",
56
+ "insertTextRules": 4,
57
+ "sortText": "00_https_site"
58
+ },
59
+ {
60
+ "label": "http site",
61
+ "kind": 15,
62
+ "detail": "HTTP-only site block",
63
+ "documentation": {
64
+ "value": "Serve over plain HTTP (no automatic HTTPS).\n\n```caddyfile\nhttp://example.com {\n respond \"Not encrypted\"\n}\n```"
65
+ },
66
+ "insertText": "http://${1:example.com} {\n\t$0\n}",
67
+ "insertTextRules": 4,
68
+ "sortText": "00_http_site"
69
+ },
70
+ {
71
+ "label": "global options",
72
+ "kind": 15,
73
+ "detail": "Global options block",
74
+ "documentation": {
75
+ "value": "Global options appear at the top of the Caddyfile before any site blocks.\n\n```caddyfile\n{\n email admin@example.com\n acme_ca https://acme-staging-v02.api.letsencrypt.org/directory\n}\n```"
76
+ },
77
+ "insertText": "{\n\t${1:email ${2:admin@example.com}}\n\t$0\n}",
78
+ "insertTextRules": 4,
79
+ "sortText": "00_global_options"
80
+ },
81
+ {
82
+ "label": "reverse_proxy",
83
+ "kind": 14,
84
+ "detail": "Reverse proxy directive",
85
+ "documentation": {
86
+ "value": "Proxy requests to one or more backend servers.\n\n```caddyfile\nreverse_proxy localhost:3000\n```"
87
+ },
88
+ "insertText": "reverse_proxy ${1:localhost:3000}",
89
+ "insertTextRules": 4,
90
+ "sortText": "00_reverse_proxy"
91
+ },
92
+ {
93
+ "label": "reverse_proxy with headers",
94
+ "kind": 15,
95
+ "detail": "Reverse proxy with header manipulation",
96
+ "documentation": {
97
+ "value": "Proxy with custom header modifications.\n\n```caddyfile\nreverse_proxy localhost:3000 {\n header_up Host {upstream_hostport}\n header_up X-Real-IP {remote_host}\n}\n```"
98
+ },
99
+ "insertText": "reverse_proxy ${1:localhost:3000} {\n\theader_up ${2:Host} ${3:{upstream_hostport\\}}\n\theader_up ${4:X-Real-IP} ${5:{remote_host\\}}\n\t$0\n}",
100
+ "insertTextRules": 4,
101
+ "sortText": "00_reverse_proxy_with_headers"
102
+ },
103
+ {
104
+ "label": "reverse_proxy with load balancing",
105
+ "kind": 15,
106
+ "detail": "Reverse proxy with load balancing",
107
+ "documentation": {
108
+ "value": "Load balance across multiple backends.\n\n```caddyfile\nreverse_proxy localhost:3001 localhost:3002 localhost:3003 {\n lb_policy round_robin\n}\n```"
109
+ },
110
+ "insertText": "reverse_proxy ${1:localhost:3001} ${2:localhost:3002} {\n\tlb_policy ${3|round_robin,least_conn,first,random,ip_hash,uri_hash,cookie,header|}\n\t$0\n}",
111
+ "insertTextRules": 4,
112
+ "sortText": "00_reverse_proxy_with_load_balancing"
113
+ },
114
+ {
115
+ "label": "reverse_proxy with health checks",
116
+ "kind": 15,
117
+ "detail": "Reverse proxy with health checks",
118
+ "documentation": {
119
+ "value": "Configure active health checking for backends.\n\n```caddyfile\nreverse_proxy localhost:3001 localhost:3002 {\n health_uri /health\n health_interval 10s\n health_timeout 5s\n}\n```"
120
+ },
121
+ "insertText": "reverse_proxy ${1:localhost:3001} ${2:localhost:3002} {\n\thealth_uri ${3:/health}\n\thealth_interval ${4:10s}\n\thealth_timeout ${5:5s}\n\t$0\n}",
122
+ "insertTextRules": 4,
123
+ "sortText": "00_reverse_proxy_with_health_checks"
124
+ },
125
+ {
126
+ "label": "reverse_proxy with transport",
127
+ "kind": 15,
128
+ "detail": "Reverse proxy with custom transport",
129
+ "documentation": {
130
+ "value": "Configure the upstream transport (e.g., for HTTPS backends).\n\n```caddyfile\nreverse_proxy localhost:8443 {\n transport http {\n tls_insecure_skip_verify\n }\n}\n```"
131
+ },
132
+ "insertText": "reverse_proxy ${1:localhost:8443} {\n\ttransport http {\n\t\t${2:tls_insecure_skip_verify}\n\t}\n\t$0\n}",
133
+ "insertTextRules": 4,
134
+ "sortText": "00_reverse_proxy_with_transport"
135
+ },
136
+ {
137
+ "label": "reverse_proxy with circuit breaker",
138
+ "kind": 15,
139
+ "detail": "Reverse proxy with circuit breaker",
140
+ "documentation": {
141
+ "value": "Add circuit breaker to upstream.\n\n```caddyfile\nreverse_proxy localhost:3000 {\n cb_type count\n cb_threshold 5\n cb_timeout 30s\n}\n```"
142
+ },
143
+ "insertText": "reverse_proxy ${1:localhost:3000} {\n\tcb_type ${2|count,latency|}\n\tcb_threshold ${3:5}\n\tcb_timeout ${4:30s}\n\t$0\n}",
144
+ "insertTextRules": 4,
145
+ "sortText": "00_reverse_proxy_with_circuit_breaker"
146
+ },
147
+ {
148
+ "label": "file_server",
149
+ "kind": 14,
150
+ "detail": "Static file server directive",
151
+ "documentation": {
152
+ "value": "Serve static files from the site root.\n\n```caddyfile\nfile_server\n```"
153
+ },
154
+ "insertText": "file_server",
155
+ "insertTextRules": 4,
156
+ "sortText": "00_file_server"
157
+ },
158
+ {
159
+ "label": "file_server browse",
160
+ "kind": 15,
161
+ "detail": "File server with directory browsing",
162
+ "documentation": {
163
+ "value": "Enable directory listing.\n\n```caddyfile\nfile_server browse\n```"
164
+ },
165
+ "insertText": "file_server browse",
166
+ "insertTextRules": 4,
167
+ "sortText": "00_file_server_browse"
168
+ },
169
+ {
170
+ "label": "file_server with root",
171
+ "kind": 15,
172
+ "detail": "File server with root path",
173
+ "documentation": {
174
+ "value": "Serve files from a specific directory.\n\n```caddyfile\nroot * /var/www/html\nfile_server\n```"
175
+ },
176
+ "insertText": "root * ${1:/var/www/html}\nfile_server",
177
+ "insertTextRules": 4,
178
+ "sortText": "00_file_server_with_root"
179
+ },
180
+ {
181
+ "label": "file_server with hide",
182
+ "kind": 15,
183
+ "detail": "File server hiding files",
184
+ "documentation": {
185
+ "value": "Hide certain files from being served.\n\n```caddyfile\nfile_server {\n hide .git .env\n}\n```"
186
+ },
187
+ "insertText": "file_server {\n\thide ${1:.git} ${2:.env}\n\t$0\n}",
188
+ "insertTextRules": 4,
189
+ "sortText": "00_file_server_with_hide"
190
+ },
191
+ {
192
+ "label": "respond",
193
+ "kind": 14,
194
+ "detail": "Static response directive",
195
+ "documentation": {
196
+ "value": "Return a static response to the client.\n\n```caddyfile\nrespond \"Hello, World!\" 200\n```"
197
+ },
198
+ "insertText": "respond \"${1:Hello, World!}\" ${2:200}",
199
+ "insertTextRules": 4,
200
+ "sortText": "00_respond"
201
+ },
202
+ {
203
+ "label": "respond with headers",
204
+ "kind": 15,
205
+ "detail": "Respond with custom headers",
206
+ "documentation": {
207
+ "value": "Static response with headers.\n\n```caddyfile\nrespond \"OK\" 200 {\n header Content-Type text/plain\n}\n```"
208
+ },
209
+ "insertText": "respond \"${1:OK}\" ${2:200} {\n\theader ${3:Content-Type} ${4:text/plain}\n\t$0\n}",
210
+ "insertTextRules": 4,
211
+ "sortText": "00_respond_with_headers"
212
+ },
213
+ {
214
+ "label": "rewrite",
215
+ "kind": 14,
216
+ "detail": "URI rewrite directive",
217
+ "documentation": {
218
+ "value": "Internally rewrite the request URI.\n\n```caddyfile\nrewrite * /index.html\n```"
219
+ },
220
+ "insertText": "rewrite ${1:*} ${2:/index.html}",
221
+ "insertTextRules": 4,
222
+ "sortText": "00_rewrite"
223
+ },
224
+ {
225
+ "label": "rewrite strip_prefix",
226
+ "kind": 15,
227
+ "detail": "Rewrite stripping prefix",
228
+ "documentation": {
229
+ "value": "Strip a path prefix from the URI.\n\n```caddyfile\nuri strip_prefix /api\n```"
230
+ },
231
+ "insertText": "uri strip_prefix ${1:/api}",
232
+ "insertTextRules": 4,
233
+ "sortText": "00_rewrite_strip_prefix"
234
+ },
235
+ {
236
+ "label": "rewrite strip_suffix",
237
+ "kind": 15,
238
+ "detail": "Rewrite stripping suffix",
239
+ "documentation": {
240
+ "value": "Strip a path suffix from the URI.\n\n```caddyfile\nuri strip_suffix .html\n```"
241
+ },
242
+ "insertText": "uri strip_suffix ${1:.html}",
243
+ "insertTextRules": 4,
244
+ "sortText": "00_rewrite_strip_suffix"
245
+ },
246
+ {
247
+ "label": "redir",
248
+ "kind": 14,
249
+ "detail": "Redirect directive",
250
+ "documentation": {
251
+ "value": "Send an HTTP redirect to the client.\n\n```caddyfile\nredir /old /new permanent\n```"
252
+ },
253
+ "insertText": "redir ${1:/old} ${2:/new} ${3:permanent}",
254
+ "insertTextRules": 4,
255
+ "sortText": "00_redir"
256
+ },
257
+ {
258
+ "label": "redir permanent",
259
+ "kind": 15,
260
+ "detail": "Permanent redirect (301)",
261
+ "documentation": {
262
+ "value": "Permanent 301 redirect.\n\n```caddyfile\nredir /old-page /new-page permanent\n```"
263
+ },
264
+ "insertText": "redir ${1:/old-page} ${2:/new-page} permanent",
265
+ "insertTextRules": 4,
266
+ "sortText": "00_redir_permanent"
267
+ },
268
+ {
269
+ "label": "redir temporary",
270
+ "kind": 15,
271
+ "detail": "Temporary redirect (302)",
272
+ "documentation": {
273
+ "value": "Temporary 302 redirect.\n\n```caddyfile\nredir /old-page /new-page temporary\n```"
274
+ },
275
+ "insertText": "redir ${1:/old-page} ${2:/new-page} temporary",
276
+ "insertTextRules": 4,
277
+ "sortText": "00_redir_temporary"
278
+ },
279
+ {
280
+ "label": "redir with placeholder",
281
+ "kind": 15,
282
+ "detail": "Redirect with placeholder",
283
+ "documentation": {
284
+ "value": "Redirect using request placeholders.\n\n```caddyfile\nredir https://www.{host}{uri} permanent\n```"
285
+ },
286
+ "insertText": "redir https://${1:www.{host\\}{uri\\}} ${2:permanent}",
287
+ "insertTextRules": 4,
288
+ "sortText": "00_redir_with_placeholder"
289
+ },
290
+ {
291
+ "label": "root",
292
+ "kind": 14,
293
+ "detail": "Set site root directory",
294
+ "documentation": {
295
+ "value": "Set the root directory for file operations.\n\n```caddyfile\nroot * /var/www/html\n```"
296
+ },
297
+ "insertText": "root * ${1:/var/www/html}",
298
+ "insertTextRules": 4,
299
+ "sortText": "00_root"
300
+ },
301
+ {
302
+ "label": "try_files",
303
+ "kind": 14,
304
+ "detail": "Try files directive",
305
+ "documentation": {
306
+ "value": "Rewrite to the first file that exists.\n\n```caddyfile\ntry_files {path} /index.html\n```"
307
+ },
308
+ "insertText": "try_files ${1:{path\\}} ${2:/index.html}",
309
+ "insertTextRules": 4,
310
+ "sortText": "00_try_files"
311
+ },
312
+ {
313
+ "label": "try_files SPA",
314
+ "kind": 15,
315
+ "detail": "SPA fallback with try_files",
316
+ "documentation": {
317
+ "value": "Single Page Application fallback.\n\n```caddyfile\ntry_files {path} {path}/ /index.html\n```"
318
+ },
319
+ "insertText": "try_files {path} {path}/ /index.html",
320
+ "insertTextRules": 4,
321
+ "sortText": "00_try_files_SPA"
322
+ },
323
+ {
324
+ "label": "try_files PHP",
325
+ "kind": 15,
326
+ "detail": "PHP try_files pattern",
327
+ "documentation": {
328
+ "value": "Standard PHP try_files with index.php fallback.\n\n```caddyfile\ntry_files {path} {path}/ /index.php?{query}\n```"
329
+ },
330
+ "insertText": "try_files {path} {path}/ /index.php?{query}",
331
+ "insertTextRules": 4,
332
+ "sortText": "00_try_files_PHP"
333
+ },
334
+ {
335
+ "label": "encode",
336
+ "kind": 14,
337
+ "detail": "Compression/encoding directive",
338
+ "documentation": {
339
+ "value": "Enable response compression.\n\n```caddyfile\nencode gzip zstd\n```"
340
+ },
341
+ "insertText": "encode ${1:gzip} ${2:zstd}",
342
+ "insertTextRules": 4,
343
+ "sortText": "00_encode"
344
+ },
345
+ {
346
+ "label": "encode gzip",
347
+ "kind": 15,
348
+ "detail": "Enable gzip compression",
349
+ "documentation": {
350
+ "value": "Enable gzip compression.\n\n```caddyfile\nencode gzip\n```"
351
+ },
352
+ "insertText": "encode gzip",
353
+ "insertTextRules": 4,
354
+ "sortText": "00_encode_gzip"
355
+ },
356
+ {
357
+ "label": "encode zstd",
358
+ "kind": 15,
359
+ "detail": "Enable zstd compression",
360
+ "documentation": {
361
+ "value": "Enable Zstandard compression.\n\n```caddyfile\nencode zstd\n```"
362
+ },
363
+ "insertText": "encode zstd",
364
+ "insertTextRules": 4,
365
+ "sortText": "00_encode_zstd"
366
+ },
367
+ {
368
+ "label": "header",
369
+ "kind": 14,
370
+ "detail": "HTTP header directive",
371
+ "documentation": {
372
+ "value": "Set, add, or remove response headers.\n\n```caddyfile\nheader X-Frame-Options DENY\n```"
373
+ },
374
+ "insertText": "header ${1:X-Frame-Options} ${2:DENY}",
375
+ "insertTextRules": 4,
376
+ "sortText": "00_header"
377
+ },
378
+ {
379
+ "label": "header set",
380
+ "kind": 15,
381
+ "detail": "Set a response header",
382
+ "documentation": {
383
+ "value": "Set a header value.\n\n```caddyfile\nheader X-Content-Type-Options nosniff\n```"
384
+ },
385
+ "insertText": "header ${1:X-Content-Type-Options} ${2:nosniff}",
386
+ "insertTextRules": 4,
387
+ "sortText": "00_header_set"
388
+ },
389
+ {
390
+ "label": "header add",
391
+ "kind": 15,
392
+ "detail": "Add a response header",
393
+ "documentation": {
394
+ "value": "Add a header (allows multiple values).\n\n```caddyfile\nheader +Link \"</style.css>; rel=preload\"\n```"
395
+ },
396
+ "insertText": "header +${1:Link} \"${2:</style.css>; rel=preload}\"",
397
+ "insertTextRules": 4,
398
+ "sortText": "00_header_add"
399
+ },
400
+ {
401
+ "label": "header delete",
402
+ "kind": 15,
403
+ "detail": "Delete a response header",
404
+ "documentation": {
405
+ "value": "Remove a response header.\n\n```caddyfile\nheader -Server\n```"
406
+ },
407
+ "insertText": "header -${1:Server}",
408
+ "insertTextRules": 4,
409
+ "sortText": "00_header_delete"
410
+ },
411
+ {
412
+ "label": "header defer",
413
+ "kind": 15,
414
+ "detail": "Deferred header manipulation",
415
+ "documentation": {
416
+ "value": "Apply header changes after the response is written by other handlers.\n\n```caddyfile\nheader {\n defer\n -Server\n +X-Powered-By \"Caddy\"\n}\n```"
417
+ },
418
+ "insertText": "header {\n\tdefer\n\t${1:-Server}\n\t$0\n}",
419
+ "insertTextRules": 4,
420
+ "sortText": "00_header_defer"
421
+ },
422
+ {
423
+ "label": "basicauth",
424
+ "kind": 14,
425
+ "detail": "Basic authentication directive",
426
+ "documentation": {
427
+ "value": "Protect a site with HTTP Basic Auth.\n\n```caddyfile\nbasicauth /admin/* {\n admin $2a$14$hash...\n}\n```"
428
+ },
429
+ "insertText": "basicauth ${1:/admin/*} {\n\t${2:username} ${3:\\$2a\\$14\\$hash}\n\t$0\n}",
430
+ "insertTextRules": 4,
431
+ "sortText": "00_basicauth"
432
+ },
433
+ {
434
+ "label": "log",
435
+ "kind": 14,
436
+ "detail": "Access log directive",
437
+ "documentation": {
438
+ "value": "Enable and configure request logging.\n\n```caddyfile\nlog {\n output file /var/log/caddy/access.log\n}\n```"
439
+ },
440
+ "insertText": "log {\n\t$0\n}",
441
+ "insertTextRules": 4,
442
+ "sortText": "00_log"
443
+ },
444
+ {
445
+ "label": "log with output",
446
+ "kind": 15,
447
+ "detail": "Log with file output",
448
+ "documentation": {
449
+ "value": "Write logs to a file.\n\n```caddyfile\nlog {\n output file /var/log/caddy/access.log {\n roll_size 100mb\n roll_keep 5\n }\n}\n```"
450
+ },
451
+ "insertText": "log {\n\toutput file ${1:/var/log/caddy/access.log} {\n\t\troll_size ${2:100mb}\n\t\troll_keep ${3:5}\n\t}\n\t$0\n}",
452
+ "insertTextRules": 4,
453
+ "sortText": "00_log_with_output"
454
+ },
455
+ {
456
+ "label": "log with format",
457
+ "kind": 15,
458
+ "detail": "Log with custom format",
459
+ "documentation": {
460
+ "value": "Use a custom log format.\n\n```caddyfile\nlog {\n format json\n}\n```"
461
+ },
462
+ "insertText": "log {\n\tformat ${1|json,console,transform|}\n\t$0\n}",
463
+ "insertTextRules": 4,
464
+ "sortText": "00_log_with_format"
465
+ },
466
+ {
467
+ "label": "log with sampling",
468
+ "kind": 15,
469
+ "detail": "Log with sampling",
470
+ "documentation": {
471
+ "value": "Sample logs to reduce volume.\n\n```caddyfile\nlog {\n sampling {\n interval 100\n first 10\n thereafter 20\n }\n}\n```"
472
+ },
473
+ "insertText": "log {\n\tsampling {\n\t\tinterval ${1:100}\n\t\tfirst ${2:10}\n\t\tthereafter ${3:20}\n\t}\n\t$0\n}",
474
+ "insertTextRules": 4,
475
+ "sortText": "00_log_with_sampling"
476
+ },
477
+ {
478
+ "label": "tls",
479
+ "kind": 14,
480
+ "detail": "TLS directive",
481
+ "documentation": {
482
+ "value": "Configure TLS/HTTPS settings.\n\n```caddyfile\ntls admin@example.com\n```"
483
+ },
484
+ "insertText": "tls ${1:admin@example.com}",
485
+ "insertTextRules": 4,
486
+ "sortText": "00_tls"
487
+ },
488
+ {
489
+ "label": "tls self-signed",
490
+ "kind": 15,
491
+ "detail": "Self-signed TLS certificate",
492
+ "documentation": {
493
+ "value": "Use Caddy's internal self-signed certificate.\n\n```caddyfile\ntls internal\n```"
494
+ },
495
+ "insertText": "tls internal",
496
+ "insertTextRules": 4,
497
+ "sortText": "00_tls_self-signed"
498
+ },
499
+ {
500
+ "label": "tls internal",
501
+ "kind": 15,
502
+ "detail": "Internal TLS (self-signed)",
503
+ "documentation": {
504
+ "value": "Use Caddy's internal issuer.\n\n```caddyfile\ntls internal {\n on_demand\n}\n```"
505
+ },
506
+ "insertText": "tls internal {\n\t${1:on_demand}\n\t$0\n}",
507
+ "insertTextRules": 4,
508
+ "sortText": "00_tls_internal"
509
+ },
510
+ {
511
+ "label": "tls dns challenge",
512
+ "kind": 15,
513
+ "detail": "TLS with DNS challenge",
514
+ "documentation": {
515
+ "value": "Use DNS challenge for wildcard or non-public certs.\n\n```caddyfile\ntls {\n dns cloudflare {env.CF_API_TOKEN}\n}\n```"
516
+ },
517
+ "insertText": "tls {\n\tdns ${1:cloudflare} ${2:{env.CF_API_TOKEN\\}}\n\t$0\n}",
518
+ "insertTextRules": 4,
519
+ "sortText": "00_tls_dns_challenge"
520
+ },
521
+ {
522
+ "label": "tls with protocols",
523
+ "kind": 15,
524
+ "detail": "TLS with protocol versions",
525
+ "documentation": {
526
+ "value": "Restrict TLS protocol versions.\n\n```caddyfile\ntls {\n protocols tls1.2 tls1.3\n}\n```"
527
+ },
528
+ "insertText": "tls {\n\tprotocols ${1:tls1.2} ${2:tls1.3}\n\t$0\n}",
529
+ "insertTextRules": 4,
530
+ "sortText": "00_tls_with_protocols"
531
+ },
532
+ {
533
+ "label": "tls with ciphers",
534
+ "kind": 15,
535
+ "detail": "TLS with custom ciphers",
536
+ "documentation": {
537
+ "value": "Specify allowed cipher suites.\n\n```caddyfile\ntls {\n ciphers TLS_AES_256_GCM_SHA384 TLS_CHACHA20_POLY1305_SHA256\n}\n```"
538
+ },
539
+ "insertText": "tls {\n\tciphers ${1:TLS_AES_256_GCM_SHA384} ${2:TLS_CHACHA20_POLY1305_SHA256}\n\t$0\n}",
540
+ "insertTextRules": 4,
541
+ "sortText": "00_tls_with_ciphers"
542
+ },
543
+ {
544
+ "label": "tls client auth",
545
+ "kind": 15,
546
+ "detail": "TLS with client authentication",
547
+ "documentation": {
548
+ "value": "Require client certificates.\n\n```caddyfile\ntls {\n client_auth {\n mode require_and_verify\n trusted_ca_cert_file /etc/caddy/ca.pem\n }\n}\n```"
549
+ },
550
+ "insertText": "tls {\n\tclient_auth {\n\t\tmode ${1|require_and_verify,require,request,verify_if_given|}\n\t\ttrusted_ca_cert_file ${2:/etc/caddy/ca.pem}\n\t}\n\t$0\n}",
551
+ "insertTextRules": 4,
552
+ "sortText": "00_tls_client_auth"
553
+ },
554
+ {
555
+ "label": "handle",
556
+ "kind": 14,
557
+ "detail": "Handle directive",
558
+ "documentation": {
559
+ "value": "Mutually exclusive handler groups. First matching block wins.\n\n```caddyfile\nhandle /api/* {\n reverse_proxy localhost:8080\n}\n```"
560
+ },
561
+ "insertText": "handle ${1:/api/*} {\n\t$0\n}",
562
+ "insertTextRules": 4,
563
+ "sortText": "00_handle"
564
+ },
565
+ {
566
+ "label": "handle_path",
567
+ "kind": 14,
568
+ "detail": "Handle path directive (strip prefix)",
569
+ "documentation": {
570
+ "value": "Like handle, but strips the matched path prefix before handling.\n\n```caddyfile\nhandle_path /api/* {\n reverse_proxy localhost:8080\n}\n```"
571
+ },
572
+ "insertText": "handle_path ${1:/api/*} {\n\t$0\n}",
573
+ "insertTextRules": 4,
574
+ "sortText": "00_handle_path"
575
+ },
576
+ {
577
+ "label": "route",
578
+ "kind": 14,
579
+ "detail": "Route directive",
580
+ "documentation": {
581
+ "value": "Execute directives in the exact order listed (no automatic reordering).\n\n```caddyfile\nroute {\n rewrite /old /new\n reverse_proxy localhost:3000\n}\n```"
582
+ },
583
+ "insertText": "route {\n\t$0\n}",
584
+ "insertTextRules": 4,
585
+ "sortText": "00_route"
586
+ },
587
+ {
588
+ "label": "import",
589
+ "kind": 14,
590
+ "detail": "Import directive",
591
+ "documentation": {
592
+ "value": "Include a snippet or file.\n\n```caddyfile\nimport common_headers\n```"
593
+ },
594
+ "insertText": "import ${1:snippet_name}",
595
+ "insertTextRules": 4,
596
+ "sortText": "00_import"
597
+ },
598
+ {
599
+ "label": "import file",
600
+ "kind": 15,
601
+ "detail": "Import an external file",
602
+ "documentation": {
603
+ "value": "Include an external Caddyfile or snippet.\n\n```caddyfile\nimport /etc/caddy/sites/*.caddy\n```"
604
+ },
605
+ "insertText": "import ${1:/etc/caddy/sites/*.caddy}",
606
+ "insertTextRules": 4,
607
+ "sortText": "00_import_file"
608
+ },
609
+ {
610
+ "label": "snippet definition",
611
+ "kind": 15,
612
+ "detail": "Define a reusable snippet",
613
+ "documentation": {
614
+ "value": "Define a snippet that can be imported.\n\n```caddyfile\n(common_headers) {\n header X-Frame-Options DENY\n header X-Content-Type-Options nosniff\n}\n```"
615
+ },
616
+ "insertText": "(${1:snippet_name}) {\n\t$0\n}",
617
+ "insertTextRules": 4,
618
+ "sortText": "00_snippet_definition"
619
+ },
620
+ {
621
+ "label": "templates",
622
+ "kind": 14,
623
+ "detail": "Templates directive",
624
+ "documentation": {
625
+ "value": "Enable server-side template evaluation.\n\n```caddyfile\ntemplates\n```"
626
+ },
627
+ "insertText": "templates",
628
+ "insertTextRules": 4,
629
+ "sortText": "00_templates"
630
+ },
631
+ {
632
+ "label": "php_fastcgi",
633
+ "kind": 14,
634
+ "detail": "PHP FastCGI directive",
635
+ "documentation": {
636
+ "value": "Shortcut for PHP-FPM reverse proxying.\n\n```caddyfile\nphp_fastcgi localhost:9000\n```"
637
+ },
638
+ "insertText": "php_fastcgi ${1:localhost:9000}",
639
+ "insertTextRules": 4,
640
+ "sortText": "00_php_fastcgi"
641
+ },
642
+ {
643
+ "label": "php_fastcgi with root",
644
+ "kind": 15,
645
+ "detail": "PHP FastCGI with root",
646
+ "documentation": {
647
+ "value": "PHP FastCGI with a custom document root.\n\n```caddyfile\nroot * /var/www/html\nphp_fastcgi localhost:9000\n```"
648
+ },
649
+ "insertText": "root * ${1:/var/www/html}\nphp_fastcgi ${2:localhost:9000}",
650
+ "insertTextRules": 4,
651
+ "sortText": "00_php_fastcgi_with_root"
652
+ },
653
+ {
654
+ "label": "php_fastcgi with split",
655
+ "kind": 15,
656
+ "detail": "PHP FastCGI with split path",
657
+ "documentation": {
658
+ "value": "PHP FastCGI with custom split path info.\n\n```caddyfile\nphp_fastcgi localhost:9000 {\n split .php\n}\n```"
659
+ },
660
+ "insertText": "php_fastcgi ${1:localhost:9000} {\n\tsplit ${2:.php}\n\t$0\n}",
661
+ "insertTextRules": 4,
662
+ "sortText": "00_php_fastcgi_with_split"
663
+ },
664
+ {
665
+ "label": "handle_errors",
666
+ "kind": 14,
667
+ "detail": "Handle errors directive",
668
+ "documentation": {
669
+ "value": "Define custom error pages.\n\n```caddyfile\nhandle_errors {\n respond \"{err.status_code} {err.status_text}\"\n}\n```"
670
+ },
671
+ "insertText": "handle_errors {\n\t$0\n}",
672
+ "insertTextRules": 4,
673
+ "sortText": "00_handle_errors"
674
+ },
675
+ {
676
+ "label": "handle_errors with respond",
677
+ "kind": 15,
678
+ "detail": "Error handler with custom response",
679
+ "documentation": {
680
+ "value": "Custom error page with status code.\n\n```caddyfile\nhandle_errors {\n @404 expression {err.status_code} == 404\n handle @404 {\n rewrite * /404.html\n file_server\n }\n}\n```"
681
+ },
682
+ "insertText": "handle_errors {\n\t@${1:404} expression {err.status_code} == ${2:404}\n\thandle @${1:404} {\n\t\trewrite * ${3:/404.html}\n\t\tfile_server\n\t}\n\t$0\n}",
683
+ "insertTextRules": 4,
684
+ "sortText": "00_handle_errors_with_respond"
685
+ },
686
+ {
687
+ "label": "abort",
688
+ "kind": 14,
689
+ "detail": "Abort directive",
690
+ "documentation": {
691
+ "value": "Immediately abort the connection with no response.\n\n```caddyfile\nabort\n```"
692
+ },
693
+ "insertText": "abort",
694
+ "insertTextRules": 4,
695
+ "sortText": "00_abort"
696
+ },
697
+ {
698
+ "label": "error",
699
+ "kind": 14,
700
+ "detail": "Error directive",
701
+ "documentation": {
702
+ "value": "Trigger an HTTP error.\n\n```caddyfile\nerror /secret/* \"Access denied\" 403\n```"
703
+ },
704
+ "insertText": "error ${1:\"${2:Not Found}\"} ${3:404}",
705
+ "insertTextRules": 4,
706
+ "sortText": "00_error"
707
+ },
708
+ {
709
+ "label": "uri",
710
+ "kind": 14,
711
+ "detail": "URI manipulation directive",
712
+ "documentation": {
713
+ "value": "Manipulate the request URI.\n\n```caddyfile\nuri strip_prefix /api\n```"
714
+ },
715
+ "insertText": "uri ${1|strip_prefix,strip_suffix,replace,path_regexp|} ${2}",
716
+ "insertTextRules": 4,
717
+ "sortText": "00_uri"
718
+ },
719
+ {
720
+ "label": "uri strip_prefix",
721
+ "kind": 15,
722
+ "detail": "URI strip prefix",
723
+ "documentation": {
724
+ "value": "Strip a path prefix.\n\n```caddyfile\nuri strip_prefix /api\n```"
725
+ },
726
+ "insertText": "uri strip_prefix ${1:/api}",
727
+ "insertTextRules": 4,
728
+ "sortText": "00_uri_strip_prefix"
729
+ },
730
+ {
731
+ "label": "uri strip_suffix",
732
+ "kind": 15,
733
+ "detail": "URI strip suffix",
734
+ "documentation": {
735
+ "value": "Strip a path suffix.\n\n```caddyfile\nuri strip_suffix .html\n```"
736
+ },
737
+ "insertText": "uri strip_suffix ${1:.html}",
738
+ "insertTextRules": 4,
739
+ "sortText": "00_uri_strip_suffix"
740
+ },
741
+ {
742
+ "label": "uri replace",
743
+ "kind": 15,
744
+ "detail": "URI replace",
745
+ "documentation": {
746
+ "value": "Replace part of the URI.\n\n```caddyfile\nuri replace /old /new\n```"
747
+ },
748
+ "insertText": "uri replace ${1:/old} ${2:/new}",
749
+ "insertTextRules": 4,
750
+ "sortText": "00_uri_replace"
751
+ },
752
+ {
753
+ "label": "uri path_regexp",
754
+ "kind": 15,
755
+ "detail": "URI path regexp replacement",
756
+ "documentation": {
757
+ "value": "Regex-based URI path rewriting.\n\n```caddyfile\nuri path_regexp /user/(\\d+) /profile?id=$1\n```"
758
+ },
759
+ "insertText": "uri path_regexp ${1:pattern} ${2:replacement}",
760
+ "insertTextRules": 4,
761
+ "sortText": "00_uri_path_regexp"
762
+ },
763
+ {
764
+ "label": "vars",
765
+ "kind": 14,
766
+ "detail": "Set variables directive",
767
+ "documentation": {
768
+ "value": "Map variables for later use in the request context.\n\n```caddyfile\nvars {\n my_var \"some value\"\n}\n```"
769
+ },
770
+ "insertText": "vars {\n\t${1:key} ${2:value}\n\t$0\n}",
771
+ "insertTextRules": 4,
772
+ "sortText": "00_vars"
773
+ },
774
+ {
775
+ "label": "map",
776
+ "kind": 14,
777
+ "detail": "Map directive",
778
+ "documentation": {
779
+ "value": "Map an input value to one or more output variables.\n\n```caddyfile\nmap {host} {my_var} {\n example.com \"value1\"\n default \"fallback\"\n}\n```"
780
+ },
781
+ "insertText": "map ${1:{host\\}} ${2:{my_var\\}} {\n\t${3:input} ${4:output}\n\tdefault ${5:fallback}\n\t$0\n}",
782
+ "insertTextRules": 4,
783
+ "sortText": "00_map"
784
+ },
785
+ {
786
+ "label": "bind",
787
+ "kind": 14,
788
+ "detail": "Bind directive",
789
+ "documentation": {
790
+ "value": "Bind the listener to a specific interface address.\n\n```caddyfile\nbind 127.0.0.1\n```"
791
+ },
792
+ "insertText": "bind ${1:127.0.0.1}",
793
+ "insertTextRules": 4,
794
+ "sortText": "00_bind"
795
+ },
796
+ {
797
+ "label": "metrics",
798
+ "kind": 14,
799
+ "detail": "Metrics directive",
800
+ "documentation": {
801
+ "value": "Enable Prometheus metrics endpoint.\n\n```caddyfile\nmetrics /metrics\n```"
802
+ },
803
+ "insertText": "metrics ${1:/metrics}",
804
+ "insertTextRules": 4,
805
+ "sortText": "00_metrics"
806
+ },
807
+ {
808
+ "label": "tracing",
809
+ "kind": 14,
810
+ "detail": "Tracing directive",
811
+ "documentation": {
812
+ "value": "Enable distributed tracing (OpenTelemetry).\n\n```caddyfile\ntracing {\n span my-span\n}\n```"
813
+ },
814
+ "insertText": "tracing {\n\tspan ${1:my-span}\n\t$0\n}",
815
+ "insertTextRules": 4,
816
+ "sortText": "00_tracing"
817
+ },
818
+ {
819
+ "label": "acme_server",
820
+ "kind": 14,
821
+ "detail": "ACME server directive",
822
+ "documentation": {
823
+ "value": "Serve ACME certificates (built-in CA).\n\n```caddyfile\nacme_server\n```"
824
+ },
825
+ "insertText": "acme_server",
826
+ "insertTextRules": 4,
827
+ "sortText": "00_acme_server"
828
+ },
829
+ {
830
+ "label": "@path matcher",
831
+ "kind": 15,
832
+ "detail": "Named path matcher",
833
+ "documentation": {
834
+ "value": "Match requests by URI path.\n\n```caddyfile\n@api path /api/*\n```"
835
+ },
836
+ "insertText": "@${1:name} path ${2:/api/*}",
837
+ "insertTextRules": 4,
838
+ "sortText": "00_@path_matcher"
839
+ },
840
+ {
841
+ "label": "@host matcher",
842
+ "kind": 15,
843
+ "detail": "Named host matcher",
844
+ "documentation": {
845
+ "value": "Match requests by hostname.\n\n```caddyfile\n@example host example.com\n```"
846
+ },
847
+ "insertText": "@${1:name} host ${2:example.com}",
848
+ "insertTextRules": 4,
849
+ "sortText": "00_@host_matcher"
850
+ },
851
+ {
852
+ "label": "@method matcher",
853
+ "kind": 15,
854
+ "detail": "Named method matcher",
855
+ "documentation": {
856
+ "value": "Match requests by HTTP method.\n\n```caddyfile\n@post method POST\n```"
857
+ },
858
+ "insertText": "@${1:name} method ${2|GET,POST,PUT,DELETE,PATCH,OPTIONS,HEAD|}",
859
+ "insertTextRules": 4,
860
+ "sortText": "00_@method_matcher"
861
+ },
862
+ {
863
+ "label": "@header matcher",
864
+ "kind": 15,
865
+ "detail": "Named header matcher",
866
+ "documentation": {
867
+ "value": "Match requests by header value.\n\n```caddyfile\n@websocket header Connection *Upgrade*\n```"
868
+ },
869
+ "insertText": "@${1:name} header ${2:Connection} ${3:*Upgrade*}",
870
+ "insertTextRules": 4,
871
+ "sortText": "00_@header_matcher"
872
+ },
873
+ {
874
+ "label": "@query matcher",
875
+ "kind": 15,
876
+ "detail": "Named query matcher",
877
+ "documentation": {
878
+ "value": "Match requests by query string parameter.\n\n```caddyfile\n@debug query debug=true\n```"
879
+ },
880
+ "insertText": "@${1:name} query ${2:key}=${3:value}",
881
+ "insertTextRules": 4,
882
+ "sortText": "00_@query_matcher"
883
+ },
884
+ {
885
+ "label": "@remote_ip matcher",
886
+ "kind": 15,
887
+ "detail": "Named remote IP matcher",
888
+ "documentation": {
889
+ "value": "Match requests by client IP address.\n\n```caddyfile\n@local remote_ip 192.168.0.0/16\n```"
890
+ },
891
+ "insertText": "@${1:name} remote_ip ${2:192.168.0.0/16}",
892
+ "insertTextRules": 4,
893
+ "sortText": "00_@remote_ip_matcher"
894
+ },
895
+ {
896
+ "label": "@protocol matcher",
897
+ "kind": 15,
898
+ "detail": "Named protocol matcher",
899
+ "documentation": {
900
+ "value": "Match requests by protocol (http or https).\n\n```caddyfile\n@secure protocol https\n```"
901
+ },
902
+ "insertText": "@${1:name} protocol ${2|http,https|}",
903
+ "insertTextRules": 4,
904
+ "sortText": "00_@protocol_matcher"
905
+ },
906
+ {
907
+ "label": "@expression matcher",
908
+ "kind": 15,
909
+ "detail": "Named expression matcher",
910
+ "documentation": {
911
+ "value": "Match using a CEL expression.\n\n```caddyfile\n@mobile expression {http.request.header.User-Agent}.contains(\"Mobile\")\n```"
912
+ },
913
+ "insertText": "@${1:name} expression ${2:{http.request.header.User-Agent\\}.contains(\"${3:Mobile}\")}",
914
+ "insertTextRules": 4,
915
+ "sortText": "00_@expression_matcher"
916
+ },
917
+ {
918
+ "label": "@file matcher",
919
+ "kind": 15,
920
+ "detail": "Named file matcher",
921
+ "documentation": {
922
+ "value": "Match based on file existence.\n\n```caddyfile\n@static file {\n try_files {path} {path}/index.html\n}\n```"
923
+ },
924
+ "insertText": "@${1:name} file {\n\ttry_files ${2:{path\\}} ${3:{path\\}/index.html}\n\t$0\n}",
925
+ "insertTextRules": 4,
926
+ "sortText": "00_@file_matcher"
927
+ },
928
+ {
929
+ "label": "@not matcher",
930
+ "kind": 15,
931
+ "detail": "Named not (negation) matcher",
932
+ "documentation": {
933
+ "value": "Negate another matcher.\n\n```caddyfile\n@notAPI not path /api/*\n```"
934
+ },
935
+ "insertText": "@${1:name} not ${2:path} ${3:/api/*}",
936
+ "insertTextRules": 4,
937
+ "sortText": "00_@not_matcher"
938
+ },
939
+ {
940
+ "label": "@api pattern",
941
+ "kind": 15,
942
+ "detail": "API route matcher",
943
+ "documentation": {
944
+ "value": "Named matcher for API routes.\n\n```caddyfile\n@api {\n path /api/*\n}\n```"
945
+ },
946
+ "insertText": "@api {\n\tpath /api/*\n\t$0\n}",
947
+ "insertTextRules": 4,
948
+ "sortText": "00_@api_pattern"
949
+ },
950
+ {
951
+ "label": "@static pattern",
952
+ "kind": 15,
953
+ "detail": "Static file matcher",
954
+ "documentation": {
955
+ "value": "Named matcher for static assets.\n\n```caddyfile\n@static {\n path *.css *.js *.png *.jpg *.gif *.svg *.ico *.woff *.woff2\n}\n```"
956
+ },
957
+ "insertText": "@static {\n\tpath *.css *.js *.png *.jpg *.gif *.svg *.ico *.woff *.woff2\n\t$0\n}",
958
+ "insertTextRules": 4,
959
+ "sortText": "00_@static_pattern"
960
+ },
961
+ {
962
+ "label": "@websocket pattern",
963
+ "kind": 15,
964
+ "detail": "WebSocket matcher",
965
+ "documentation": {
966
+ "value": "Named matcher for WebSocket upgrades.\n\n```caddyfile\n@websocket {\n header Connection *Upgrade*\n header Upgrade websocket\n}\n```"
967
+ },
968
+ "insertText": "@websocket {\n\theader Connection *Upgrade*\n\theader Upgrade websocket\n\t$0\n}",
969
+ "insertTextRules": 4,
970
+ "sortText": "00_@websocket_pattern"
971
+ },
972
+ {
973
+ "label": "email",
974
+ "kind": 15,
975
+ "detail": "ACME email global option",
976
+ "documentation": {
977
+ "value": "Email for ACME certificate registration.\n\n```caddyfile\n{\n email admin@example.com\n}\n```"
978
+ },
979
+ "insertText": "email ${1:admin@example.com}",
980
+ "insertTextRules": 4,
981
+ "sortText": "00_email"
982
+ },
983
+ {
984
+ "label": "acme_ca",
985
+ "kind": 15,
986
+ "detail": "ACME CA URL global option",
987
+ "documentation": {
988
+ "value": "Custom ACME Certificate Authority endpoint.\n\n```caddyfile\n{\n acme_ca https://acme-staging-v02.api.letsencrypt.org/directory\n}\n```"
989
+ },
990
+ "insertText": "acme_ca ${1:https://acme-staging-v02.api.letsencrypt.org/directory}",
991
+ "insertTextRules": 4,
992
+ "sortText": "00_acme_ca"
993
+ },
994
+ {
995
+ "label": "acme_dns",
996
+ "kind": 15,
997
+ "detail": "ACME DNS provider global option",
998
+ "documentation": {
999
+ "value": "Configure DNS challenge provider globally.\n\n```caddyfile\n{\n acme_dns cloudflare {env.CF_API_TOKEN}\n}\n```"
1000
+ },
1001
+ "insertText": "acme_dns ${1:cloudflare} ${2:{env.CF_API_TOKEN\\}}",
1002
+ "insertTextRules": 4,
1003
+ "sortText": "00_acme_dns"
1004
+ },
1005
+ {
1006
+ "label": "admin",
1007
+ "kind": 15,
1008
+ "detail": "Admin API global option",
1009
+ "documentation": {
1010
+ "value": "Configure the admin API endpoint.\n\n```caddyfile\n{\n admin off\n}\n```"
1011
+ },
1012
+ "insertText": "admin ${1|off,localhost:2019|}",
1013
+ "insertTextRules": 4,
1014
+ "sortText": "00_admin"
1015
+ },
1016
+ {
1017
+ "label": "auto_https",
1018
+ "kind": 15,
1019
+ "detail": "Auto HTTPS global option",
1020
+ "documentation": {
1021
+ "value": "Control automatic HTTPS behavior.\n\n```caddyfile\n{\n auto_https off\n}\n```"
1022
+ },
1023
+ "insertText": "auto_https ${1|off,disable_redirects,disable_certs,ignore_loaded_certs|}",
1024
+ "insertTextRules": 4,
1025
+ "sortText": "00_auto_https"
1026
+ },
1027
+ {
1028
+ "label": "grace_period",
1029
+ "kind": 15,
1030
+ "detail": "Grace period global option",
1031
+ "documentation": {
1032
+ "value": "Set the shutdown grace period.\n\n```caddyfile\n{\n grace_period 30s\n}\n```"
1033
+ },
1034
+ "insertText": "grace_period ${1:30s}",
1035
+ "insertTextRules": 4,
1036
+ "sortText": "00_grace_period"
1037
+ },
1038
+ {
1039
+ "label": "servers",
1040
+ "kind": 15,
1041
+ "detail": "Servers global option block",
1042
+ "documentation": {
1043
+ "value": "Configure listener servers.\n\n```caddyfile\n{\n servers {\n protocol {\n experimental_http3\n }\n }\n}\n```"
1044
+ },
1045
+ "insertText": "servers {\n\t${1:protocol {\n\t\texperimental_http3\n\t\\}}\n\t$0\n}",
1046
+ "insertTextRules": 4,
1047
+ "sortText": "00_servers"
1048
+ },
1049
+ {
1050
+ "label": "log global",
1051
+ "kind": 15,
1052
+ "detail": "Global log option",
1053
+ "documentation": {
1054
+ "value": "Configure global (non-site) logging.\n\n```caddyfile\n{\n log {\n level INFO\n output stderr\n }\n}\n```"
1055
+ },
1056
+ "insertText": "log {\n\tlevel ${1|DEBUG,INFO,WARN,ERROR|}\n\toutput ${2|stderr,stdout,file|}\n\t$0\n}",
1057
+ "insertTextRules": 4,
1058
+ "sortText": "00_log_global"
1059
+ },
1060
+ {
1061
+ "label": "ocsp_stapling",
1062
+ "kind": 15,
1063
+ "detail": "OCSP stapling global option",
1064
+ "documentation": {
1065
+ "value": "Control OCSP stapling behavior.\n\n```caddyfile\n{\n ocsp_stapling off\n}\n```"
1066
+ },
1067
+ "insertText": "ocsp_stapling ${1:off}",
1068
+ "insertTextRules": 4,
1069
+ "sortText": "00_ocsp_stapling"
1070
+ },
1071
+ {
1072
+ "label": "storage",
1073
+ "kind": 15,
1074
+ "detail": "Storage global option",
1075
+ "documentation": {
1076
+ "value": "Configure TLS certificate storage backend.\n\n```caddyfile\n{\n storage file_system {\n root /data/caddy\n }\n}\n```"
1077
+ },
1078
+ "insertText": "storage ${1:file_system} {\n\troot ${2:/data/caddy}\n\t$0\n}",
1079
+ "insertTextRules": 4,
1080
+ "sortText": "00_storage"
1081
+ },
1082
+ {
1083
+ "label": "order",
1084
+ "kind": 15,
1085
+ "detail": "Directive order global option",
1086
+ "documentation": {
1087
+ "value": "Change the evaluation order of directives.\n\n```caddyfile\n{\n order my_directive before respond\n}\n```"
1088
+ },
1089
+ "insertText": "order ${1:directive} ${2|before,after,first,last|} ${3:other_directive}",
1090
+ "insertTextRules": 4,
1091
+ "sortText": "00_order"
1092
+ },
1093
+ {
1094
+ "label": "local_certs",
1095
+ "kind": 15,
1096
+ "detail": "Local certs global option",
1097
+ "documentation": {
1098
+ "value": "Use locally-trusted certificates.\n\n```caddyfile\n{\n local_certs\n}\n```"
1099
+ },
1100
+ "insertText": "local_certs",
1101
+ "insertTextRules": 4,
1102
+ "sortText": "00_local_certs"
1103
+ },
1104
+ {
1105
+ "label": "skip_install_trust",
1106
+ "kind": 15,
1107
+ "detail": "Skip install trust global option",
1108
+ "documentation": {
1109
+ "value": "Skip installing root CA in the system trust store.\n\n```caddyfile\n{\n skip_install_trust\n}\n```"
1110
+ },
1111
+ "insertText": "skip_install_trust",
1112
+ "insertTextRules": 4,
1113
+ "sortText": "00_skip_install_trust"
1114
+ },
1115
+ {
1116
+ "label": "template: static file server",
1117
+ "kind": 15,
1118
+ "detail": "Complete static file server Caddyfile",
1119
+ "documentation": {
1120
+ "value": "A full static file server configuration.\n\n```caddyfile\nexample.com {\n root * /var/www/html\n encode gzip zstd\n file_server\n}\n```"
1121
+ },
1122
+ "insertText": "${1:example.com} {\n\troot * ${2:/var/www/html}\n\tencode gzip zstd\n\tfile_server\n}",
1123
+ "insertTextRules": 4,
1124
+ "sortText": "00_template:_static_file_server"
1125
+ },
1126
+ {
1127
+ "label": "template: SPA reverse proxy",
1128
+ "kind": 15,
1129
+ "detail": "Complete SPA (React/Vue/Angular) Caddyfile",
1130
+ "documentation": {
1131
+ "value": "Full SPA with reverse proxy for API.\n\n```caddyfile\nexample.com {\n handle /api/* {\n reverse_proxy localhost:3000\n }\n handle {\n root * /var/www/spa\n try_files {path} /index.html\n file_server\n }\n}\n```"
1132
+ },
1133
+ "insertText": "${1:example.com} {\n\thandle /api/* {\n\t\treverse_proxy ${2:localhost:3000}\n\t}\n\thandle {\n\t\troot * ${3:/var/www/spa}\n\t\ttry_files {path} /index.html\n\t\tfile_server\n\t}\n}",
1134
+ "insertTextRules": 4,
1135
+ "sortText": "00_template:_SPA_reverse_proxy"
1136
+ },
1137
+ {
1138
+ "label": "template: WordPress/PHP",
1139
+ "kind": 15,
1140
+ "detail": "Complete WordPress/PHP Caddyfile",
1141
+ "documentation": {
1142
+ "value": "Full WordPress site with PHP-FPM.\n\n```caddyfile\nexample.com {\n root * /var/www/wordpress\n encode gzip\n php_fastcgi unix//run/php/php-fpm.sock\n file_server\n}\n```"
1143
+ },
1144
+ "insertText": "${1:example.com} {\n\troot * ${2:/var/www/wordpress}\n\tencode gzip\n\tphp_fastcgi ${3:unix//run/php/php-fpm.sock}\n\tfile_server\n}",
1145
+ "insertTextRules": 4,
1146
+ "sortText": "00_template:_WordPress/PHP"
1147
+ },
1148
+ {
1149
+ "label": "template: API gateway",
1150
+ "kind": 15,
1151
+ "detail": "Complete API gateway Caddyfile",
1152
+ "documentation": {
1153
+ "value": "Route multiple API services.\n\n```caddyfile\napi.example.com {\n handle /users/* {\n reverse_proxy localhost:3001\n }\n handle /orders/* {\n reverse_proxy localhost:3002\n }\n handle /auth/* {\n reverse_proxy localhost:3003\n }\n}\n```"
1154
+ },
1155
+ "insertText": "${1:api.example.com} {\n\thandle /users/* {\n\t\treverse_proxy ${2:localhost:3001}\n\t}\n\thandle /orders/* {\n\t\treverse_proxy ${3:localhost:3002}\n\t}\n\thandle /auth/* {\n\t\treverse_proxy ${4:localhost:3003}\n\t}\n}",
1156
+ "insertTextRules": 4,
1157
+ "sortText": "00_template:_API_gateway"
1158
+ },
1159
+ {
1160
+ "label": "template: load balancer",
1161
+ "kind": 15,
1162
+ "detail": "Complete load balancer Caddyfile",
1163
+ "documentation": {
1164
+ "value": "Load balance across multiple backends.\n\n```caddyfile\nexample.com {\n reverse_proxy localhost:3001 localhost:3002 localhost:3003 {\n lb_policy round_robin\n health_uri /health\n health_interval 10s\n }\n}\n```"
1165
+ },
1166
+ "insertText": "${1:example.com} {\n\treverse_proxy ${2:localhost:3001} ${3:localhost:3002} ${4:localhost:3003} {\n\t\tlb_policy ${5:round_robin}\n\t\thealth_uri ${6:/health}\n\t\thealth_interval ${7:10s}\n\t}\n}",
1167
+ "insertTextRules": 4,
1168
+ "sortText": "00_template:_load_balancer"
1169
+ },
1170
+ {
1171
+ "label": "template: wildcard cert",
1172
+ "kind": 15,
1173
+ "detail": "Wildcard certificate Caddyfile",
1174
+ "documentation": {
1175
+ "value": "Wildcard certificate with DNS challenge.\n\n```caddyfile\n*.example.com {\n tls {\n dns cloudflare {env.CF_API_TOKEN}\n }\n @app1 host app1.example.com\n handle @app1 {\n reverse_proxy localhost:3001\n }\n}\n```"
1176
+ },
1177
+ "insertText": "*.${1:example.com} {\n\ttls {\n\t\tdns ${2:cloudflare} ${3:{env.CF_API_TOKEN\\}}\n\t}\n\t@${4:app1} host ${4:app1}.${1:example.com}\n\thandle @${4:app1} {\n\t\treverse_proxy ${5:localhost:3001}\n\t}\n}",
1178
+ "insertTextRules": 4,
1179
+ "sortText": "00_template:_wildcard_cert"
1180
+ },
1181
+ {
1182
+ "label": "template: redirect HTTP to HTTPS",
1183
+ "kind": 15,
1184
+ "detail": "HTTP to HTTPS redirect Caddyfile",
1185
+ "documentation": {
1186
+ "value": "Force all traffic to HTTPS (Caddy does this automatically, but explicit version).\n\n```caddyfile\nhttp://example.com {\n redir https://{host}{uri} permanent\n}\n```"
1187
+ },
1188
+ "insertText": "http://${1:example.com} {\n\tredir https://{host}{uri} permanent\n}",
1189
+ "insertTextRules": 4,
1190
+ "sortText": "00_template:_redirect_HTTP_to_HTTPS"
1191
+ },
1192
+ {
1193
+ "label": "template: multiple sites",
1194
+ "kind": 15,
1195
+ "detail": "Multiple sites Caddyfile",
1196
+ "documentation": {
1197
+ "value": "Serve multiple sites from one Caddyfile.\n\n```caddyfile\nsite1.example.com {\n root * /var/www/site1\n file_server\n}\n\nsite2.example.com {\n reverse_proxy localhost:3000\n}\n```"
1198
+ },
1199
+ "insertText": "${1:site1.example.com} {\n\troot * ${2:/var/www/site1}\n\tfile_server\n}\n\n${3:site2.example.com} {\n\treverse_proxy ${4:localhost:3000}\n}",
1200
+ "insertTextRules": 4,
1201
+ "sortText": "00_template:_multiple_sites"
1202
+ },
1203
+ {
1204
+ "label": "template: gRPC proxy",
1205
+ "kind": 15,
1206
+ "detail": "gRPC reverse proxy Caddyfile",
1207
+ "documentation": {
1208
+ "value": "Proxy gRPC traffic.\n\n```caddyfile\ngrpc.example.com {\n reverse_proxy h2c://localhost:50051\n}\n```"
1209
+ },
1210
+ "insertText": "${1:grpc.example.com} {\n\treverse_proxy h2c://${2:localhost:50051}\n}",
1211
+ "insertTextRules": 4,
1212
+ "sortText": "00_template:_gRPC_proxy"
1213
+ },
1214
+ {
1215
+ "label": "template: WebSocket proxy",
1216
+ "kind": 15,
1217
+ "detail": "WebSocket reverse proxy Caddyfile",
1218
+ "documentation": {
1219
+ "value": "Proxy WebSocket connections.\n\n```caddyfile\nexample.com {\n @websocket {\n header Connection *Upgrade*\n header Upgrade websocket\n }\n reverse_proxy @websocket localhost:8080\n reverse_proxy localhost:3000\n}\n```"
1220
+ },
1221
+ "insertText": "${1:example.com} {\n\t@websocket {\n\t\theader Connection *Upgrade*\n\t\theader Upgrade websocket\n\t}\n\treverse_proxy @websocket ${2:localhost:8080}\n\treverse_proxy ${3:localhost:3000}\n}",
1222
+ "insertTextRules": 4,
1223
+ "sortText": "00_template:_WebSocket_proxy"
1224
+ },
1225
+ {
1226
+ "label": "{http.request.uri}",
1227
+ "kind": 4,
1228
+ "detail": "Request URI placeholder",
1229
+ "documentation": {
1230
+ "value": "The full request URI path and query string.\n\n```caddyfile\nrewrite * {http.request.uri}\n```"
1231
+ },
1232
+ "insertText": "{http.request.uri}",
1233
+ "insertTextRules": 4,
1234
+ "sortText": "01_{http.request.uri}"
1235
+ },
1236
+ {
1237
+ "label": "{http.request.host}",
1238
+ "kind": 4,
1239
+ "detail": "Request host placeholder",
1240
+ "documentation": {
1241
+ "value": "The hostname from the request.\n\n```caddyfile\nheader X-Forwarded-Host {http.request.host}\n```"
1242
+ },
1243
+ "insertText": "{http.request.host}",
1244
+ "insertTextRules": 4,
1245
+ "sortText": "01_{http.request.host}"
1246
+ },
1247
+ {
1248
+ "label": "{http.request.method}",
1249
+ "kind": 4,
1250
+ "detail": "Request method placeholder",
1251
+ "documentation": {
1252
+ "value": "The HTTP method (GET, POST, etc.).\n\n```caddyfile\n@post expression {http.request.method} == \"POST\"\n```"
1253
+ },
1254
+ "insertText": "{http.request.method}",
1255
+ "insertTextRules": 4,
1256
+ "sortText": "01_{http.request.method}"
1257
+ },
1258
+ {
1259
+ "label": "{http.request.header.*}",
1260
+ "kind": 4,
1261
+ "detail": "Request header placeholder",
1262
+ "documentation": {
1263
+ "value": "Access any request header by name.\n\n```caddyfile\nheader_up X-Original-Host {http.request.header.Host}\n```"
1264
+ },
1265
+ "insertText": "{http.request.header.${1:Host}}",
1266
+ "insertTextRules": 4,
1267
+ "sortText": "01_{http.request.header.*}"
1268
+ },
1269
+ {
1270
+ "label": "{http.request.remote.host}",
1271
+ "kind": 4,
1272
+ "detail": "Remote host placeholder",
1273
+ "documentation": {
1274
+ "value": "The client's IP address.\n\n```caddyfile\nlog {\n format filter {\n fields {\n request>remote_ip {http.request.remote.host}\n }\n }\n}\n```"
1275
+ },
1276
+ "insertText": "{http.request.remote.host}",
1277
+ "insertTextRules": 4,
1278
+ "sortText": "01_{http.request.remote.host}"
1279
+ },
1280
+ {
1281
+ "label": "{http.response.header.*}",
1282
+ "kind": 4,
1283
+ "detail": "Response header placeholder",
1284
+ "documentation": {
1285
+ "value": "Access any response header by name.\n\n```caddyfile\nheader X-Response-Time {http.response.header.X-Response-Time}\n```"
1286
+ },
1287
+ "insertText": "{http.response.header.${1:Content-Type}}",
1288
+ "insertTextRules": 4,
1289
+ "sortText": "01_{http.response.header.*}"
1290
+ },
1291
+ {
1292
+ "label": "{host}",
1293
+ "kind": 4,
1294
+ "detail": "Shorthand host placeholder",
1295
+ "documentation": {
1296
+ "value": "Shorthand for `{http.request.host}`.\n\n```caddyfile\nredir https://{host}{uri}\n```"
1297
+ },
1298
+ "insertText": "{host}",
1299
+ "insertTextRules": 4,
1300
+ "sortText": "01_{host}"
1301
+ },
1302
+ {
1303
+ "label": "{uri}",
1304
+ "kind": 4,
1305
+ "detail": "Shorthand URI placeholder",
1306
+ "documentation": {
1307
+ "value": "Shorthand for `{http.request.uri}`.\n\n```caddyfile\ntry_files {path} {uri} /index.html\n```"
1308
+ },
1309
+ "insertText": "{uri}",
1310
+ "insertTextRules": 4,
1311
+ "sortText": "01_{uri}"
1312
+ },
1313
+ {
1314
+ "label": "{path}",
1315
+ "kind": 4,
1316
+ "detail": "Shorthand path placeholder",
1317
+ "documentation": {
1318
+ "value": "The URI path (without query string).\n\n```caddyfile\ntry_files {path} /index.html\n```"
1319
+ },
1320
+ "insertText": "{path}",
1321
+ "insertTextRules": 4,
1322
+ "sortText": "01_{path}"
1323
+ },
1324
+ {
1325
+ "label": "{query}",
1326
+ "kind": 4,
1327
+ "detail": "Shorthand query placeholder",
1328
+ "documentation": {
1329
+ "value": "The raw query string.\n\n```caddyfile\nrewrite * /index.php?{query}\n```"
1330
+ },
1331
+ "insertText": "{query}",
1332
+ "insertTextRules": 4,
1333
+ "sortText": "01_{query}"
1334
+ },
1335
+ {
1336
+ "label": "{method}",
1337
+ "kind": 4,
1338
+ "detail": "Shorthand method placeholder",
1339
+ "documentation": {
1340
+ "value": "Shorthand for `{http.request.method}`.\n\n```caddyfile\n@post expression {method} == \"POST\"\n```"
1341
+ },
1342
+ "insertText": "{method}",
1343
+ "insertTextRules": 4,
1344
+ "sortText": "01_{method}"
1345
+ },
1346
+ {
1347
+ "label": "{remote_host}",
1348
+ "kind": 4,
1349
+ "detail": "Shorthand remote host placeholder",
1350
+ "documentation": {
1351
+ "value": "Shorthand for `{http.request.remote.host}`.\n\n```caddyfile\nheader_up X-Real-IP {remote_host}\n```"
1352
+ },
1353
+ "insertText": "{remote_host}",
1354
+ "insertTextRules": 4,
1355
+ "sortText": "01_{remote_host}"
1356
+ },
1357
+ {
1358
+ "label": "{err.status_code}",
1359
+ "kind": 4,
1360
+ "detail": "Error status code placeholder",
1361
+ "documentation": {
1362
+ "value": "The HTTP status code within an error handler.\n\n```caddyfile\nhandle_errors {\n respond \"{err.status_code}\"\n}\n```"
1363
+ },
1364
+ "insertText": "{err.status_code}",
1365
+ "insertTextRules": 4,
1366
+ "sortText": "01_{err.status_code}"
1367
+ },
1368
+ {
1369
+ "label": "{err.status_text}",
1370
+ "kind": 4,
1371
+ "detail": "Error status text placeholder",
1372
+ "documentation": {
1373
+ "value": "The HTTP status text within an error handler.\n\n```caddyfile\nhandle_errors {\n respond \"{err.status_code} {err.status_text}\"\n}\n```"
1374
+ },
1375
+ "insertText": "{err.status_text}",
1376
+ "insertTextRules": 4,
1377
+ "sortText": "01_{err.status_text}"
1378
+ },
1379
+ {
1380
+ "label": "{upstream_hostport}",
1381
+ "kind": 4,
1382
+ "detail": "Upstream host:port placeholder",
1383
+ "documentation": {
1384
+ "value": "The host and port of the selected upstream.\n\n```caddyfile\nreverse_proxy localhost:3000 {\n header_up Host {upstream_hostport}\n}\n```"
1385
+ },
1386
+ "insertText": "{upstream_hostport}",
1387
+ "insertTextRules": 4,
1388
+ "sortText": "01_{upstream_hostport}"
1389
+ },
1390
+ {
1391
+ "label": "{env.*}",
1392
+ "kind": 4,
1393
+ "detail": "Environment variable placeholder",
1394
+ "documentation": {
1395
+ "value": "Access environment variables.\n\n```caddyfile\ntls {\n dns cloudflare {env.CF_API_TOKEN}\n}\n```"
1396
+ },
1397
+ "insertText": "{env.${1:VAR_NAME}}",
1398
+ "insertTextRules": 4,
1399
+ "sortText": "01_{env.*}"
1400
+ },
1401
+ {
1402
+ "label": "forward_auth",
1403
+ "kind": 14,
1404
+ "detail": "Forward authentication directive",
1405
+ "documentation": {
1406
+ "value": "Delegates authentication to an external service via subrequest.\n\n```caddyfile\nforward_auth localhost:9000 {\n uri /auth\n copy_headers X-User X-Email\n}\n```"
1407
+ },
1408
+ "insertText": "forward_auth ${1:localhost:9000} {\n\turi ${2:/auth}\n\tcopy_headers ${3:X-User}\n}",
1409
+ "insertTextRules": 4,
1410
+ "sortText": "00_forward_auth"
1411
+ },
1412
+ {
1413
+ "label": "forward_auth with headers",
1414
+ "kind": 15,
1415
+ "detail": "Forward auth with header copying",
1416
+ "documentation": {
1417
+ "value": "Forward auth passing original request info and copying response headers.\n\n```caddyfile\nforward_auth localhost:9000 {\n uri /auth\n copy_headers Remote-User Remote-Email Remote-Groups\n header_up X-Original-URI {uri}\n header_up X-Original-Method {method}\n}\n```"
1418
+ },
1419
+ "insertText": "forward_auth ${1:localhost:9000} {\n\turi ${2:/auth}\n\tcopy_headers ${3:Remote-User Remote-Email}\n\theader_up X-Original-URI {uri}\n\theader_up X-Original-Method {method}\n}",
1420
+ "insertTextRules": 4,
1421
+ "sortText": "00_forward_auth_headers"
1422
+ },
1423
+ {
1424
+ "label": "request_header",
1425
+ "kind": 14,
1426
+ "detail": "Modify request headers",
1427
+ "documentation": {
1428
+ "value": "Manipulate request headers before proxying.\n\n```caddyfile\nrequest_header X-Real-IP {remote_host}\nrequest_header -Server\n```"
1429
+ },
1430
+ "insertText": "request_header ${1|+,-|}${2:Header-Name} ${3:value}",
1431
+ "insertTextRules": 4,
1432
+ "sortText": "00_request_header"
1433
+ },
1434
+ {
1435
+ "label": "request_body",
1436
+ "kind": 14,
1437
+ "detail": "Request body size limit",
1438
+ "documentation": {
1439
+ "value": "Set limits on request body.\n\n```caddyfile\nrequest_body {\n max_size 10MB\n}\n```"
1440
+ },
1441
+ "insertText": "request_body {\n\tmax_size ${1:10MB}\n}",
1442
+ "insertTextRules": 4,
1443
+ "sortText": "00_request_body"
1444
+ },
1445
+ {
1446
+ "label": "push",
1447
+ "kind": 14,
1448
+ "detail": "HTTP/2 server push",
1449
+ "documentation": {
1450
+ "value": "Configure HTTP/2 server push.\n\n```caddyfile\npush /style.css /script.js\n```"
1451
+ },
1452
+ "insertText": "push ${1:/resource}",
1453
+ "insertTextRules": 4,
1454
+ "sortText": "02_push"
1455
+ },
1456
+ {
1457
+ "label": "copy_response",
1458
+ "kind": 14,
1459
+ "detail": "Copy response from backend",
1460
+ "documentation": {
1461
+ "value": "Copy the entire response from a handled request (used in handle_errors or intercept).\n\n```caddyfile\ncopy_response\n# or with specific status:\ncopy_response 404\n```"
1462
+ },
1463
+ "insertText": "copy_response${1: 404}",
1464
+ "insertTextRules": 4,
1465
+ "sortText": "02_copy_response"
1466
+ },
1467
+ {
1468
+ "label": "copy_response_headers",
1469
+ "kind": 14,
1470
+ "detail": "Copy response headers from backend",
1471
+ "documentation": {
1472
+ "value": "Copy response headers from a handled request.\n\n```caddyfile\ncopy_response_headers {\n include Content-Type\n}\n```"
1473
+ },
1474
+ "insertText": "copy_response_headers {\n\tinclude ${1:Content-Type}\n}",
1475
+ "insertTextRules": 4,
1476
+ "sortText": "02_copy_response_headers"
1477
+ },
1478
+ {
1479
+ "label": "intercept",
1480
+ "kind": 14,
1481
+ "detail": "Intercept responses",
1482
+ "documentation": {
1483
+ "value": "Intercept responses from upstream to modify or handle them.\n\n```caddyfile\nintercept {\n @error status 4xx 5xx\n handle_response @error {\n respond \"Error: {err.status_code}\"\n }\n}\n```"
1484
+ },
1485
+ "insertText": "intercept {\n\t@${1:error} status ${2:4xx 5xx}\n\thandle_response @${1:error} {\n\t\t${3:respond \"Error\"}\n\t}\n}",
1486
+ "insertTextRules": 4,
1487
+ "sortText": "02_intercept"
1488
+ },
1489
+ {
1490
+ "label": "method",
1491
+ "kind": 14,
1492
+ "detail": "Override request method",
1493
+ "documentation": {
1494
+ "value": "Override the HTTP method of the request.\n\n```caddyfile\nmethod GET\n```"
1495
+ },
1496
+ "insertText": "method ${1:GET}",
1497
+ "insertTextRules": 4,
1498
+ "sortText": "02_method"
1499
+ },
1500
+ {
1501
+ "label": "tls on_demand",
1502
+ "kind": 15,
1503
+ "detail": "TLS with on-demand certificates",
1504
+ "documentation": {
1505
+ "value": "Enable on-demand TLS — certificates obtained at handshake time.\n\n```caddyfile\ntls {\n on_demand\n}\n\n# In global options, set the ask endpoint:\n{\n on_demand_tls {\n ask http://localhost:5555/check\n }\n}\n```"
1506
+ },
1507
+ "insertText": "tls {\n\ton_demand\n}",
1508
+ "insertTextRules": 4,
1509
+ "sortText": "01_tls_ondemand"
1510
+ },
1511
+ {
1512
+ "label": "on_demand_tls",
1513
+ "kind": 15,
1514
+ "detail": "On-demand TLS global config",
1515
+ "documentation": {
1516
+ "value": "Configure on-demand TLS in global options.\n\n```caddyfile\n{\n on_demand_tls {\n ask http://localhost:5555/check\n interval 2m\n burst 5\n }\n}\n```"
1517
+ },
1518
+ "insertText": "on_demand_tls {\n\task ${1:http://localhost:5555/check}\n\tinterval ${2:2m}\n\tburst ${3:5}\n}",
1519
+ "insertTextRules": 4,
1520
+ "sortText": "03_on_demand_tls"
1521
+ },
1522
+ {
1523
+ "label": "template: security headers",
1524
+ "kind": 15,
1525
+ "detail": "Common security headers",
1526
+ "documentation": {
1527
+ "value": "Add common security headers.\n\n```caddyfile\nheader {\n X-Content-Type-Options nosniff\n X-Frame-Options DENY\n Referrer-Policy strict-origin-when-cross-origin\n X-XSS-Protection \"1; mode=block\"\n -Server\n}\n```"
1528
+ },
1529
+ "insertText": "header {\n\tX-Content-Type-Options nosniff\n\tX-Frame-Options ${1|DENY,SAMEORIGIN|}\n\tReferrer-Policy ${2:strict-origin-when-cross-origin}\n\tX-XSS-Protection \"1; mode=block\"\n\t-Server\n}",
1530
+ "insertTextRules": 4,
1531
+ "sortText": "08_security_headers"
1532
+ },
1533
+ {
1534
+ "label": "template: CORS",
1535
+ "kind": 15,
1536
+ "detail": "CORS headers",
1537
+ "documentation": {
1538
+ "value": "Configure CORS headers.\n\n```caddyfile\n@cors {\n method OPTIONS\n}\nhandle @cors {\n header Access-Control-Allow-Origin \"{http.request.header.Origin}\"\n header Access-Control-Allow-Methods \"GET, POST, PUT, DELETE, OPTIONS\"\n header Access-Control-Allow-Headers \"Content-Type, Authorization\"\n header Access-Control-Max-Age \"3600\"\n respond 204\n}\nheader Access-Control-Allow-Origin \"{http.request.header.Origin}\"\n```"
1539
+ },
1540
+ "insertText": "@cors {\n\tmethod OPTIONS\n}\nhandle @cors {\n\theader Access-Control-Allow-Origin \"${1:*}\"\n\theader Access-Control-Allow-Methods \"${2:GET, POST, PUT, DELETE, OPTIONS}\"\n\theader Access-Control-Allow-Headers \"${3:Content-Type, Authorization}\"\n\theader Access-Control-Max-Age \"${4:3600}\"\n\trespond 204\n}\nheader Access-Control-Allow-Origin \"${1:*}\"",
1541
+ "insertTextRules": 4,
1542
+ "sortText": "08_cors"
1543
+ },
1544
+ {
1545
+ "label": "log to file",
1546
+ "kind": 15,
1547
+ "detail": "Log to file",
1548
+ "documentation": {
1549
+ "value": "Configure logging to a file.\n\n```caddyfile\nlog {\n output file /var/log/caddy/access.log {\n roll_size 100mb\n roll_keep 10\n }\n format json\n}\n```"
1550
+ },
1551
+ "insertText": "log {\n\toutput file ${1:/var/log/caddy/access.log} {\n\t\troll_size ${2:100mb}\n\t\troll_keep ${3:10}\n\t}\n\tformat ${4|json,console,filter|}\n}",
1552
+ "insertTextRules": 4,
1553
+ "sortText": "01_log_file"
1554
+ },
1555
+ {
1556
+ "label": "{http.request.tls.*}",
1557
+ "kind": 9,
1558
+ "detail": "TLS request placeholder",
1559
+ "documentation": {
1560
+ "value": "TLS-related request placeholders.\n\n- `{http.request.tls.version}` — TLS version (e.g., 1.3)\n- `{http.request.tls.cipher_suite}` — cipher suite\n- `{http.request.tls.server_name}` — SNI server name"
1561
+ },
1562
+ "insertText": "{http.request.tls.${1|version,cipher_suite,server_name|}}",
1563
+ "insertTextRules": 4,
1564
+ "sortText": "05_tls_placeholder"
1565
+ },
1566
+ {
1567
+ "label": "{http.request.cookie.*}",
1568
+ "kind": 9,
1569
+ "detail": "Cookie placeholder",
1570
+ "documentation": {
1571
+ "value": "Access a specific cookie value.\n\n```\n{http.request.cookie.session_id}\n```"
1572
+ },
1573
+ "insertText": "{http.request.cookie.${1:name}}",
1574
+ "insertTextRules": 4,
1575
+ "sortText": "05_cookie"
1576
+ },
1577
+ {
1578
+ "label": "{http.reverse_proxy.*}",
1579
+ "kind": 9,
1580
+ "detail": "Reverse proxy placeholders",
1581
+ "documentation": {
1582
+ "value": "Placeholders from reverse_proxy.\n\n- `{http.reverse_proxy.upstream.hostport}` — selected upstream address\n- `{http.reverse_proxy.upstream.host}` — upstream host\n- `{http.reverse_proxy.upstream.port}` — upstream port\n- `{http.reverse_proxy.upstream.latency}` — response time\n- `{http.reverse_proxy.header.*}` — upstream response headers"
1583
+ },
1584
+ "insertText": "{http.reverse_proxy.upstream.${1|hostport,host,port,latency|}}",
1585
+ "insertTextRules": 4,
1586
+ "sortText": "05_rp_placeholder"
1587
+ }
1588
+ ]
1589
+ }