aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_nginx.lua
blob: 660b529d7d2ecbfbfa45db809f496a0df0f09716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
-- mod-version:3 --lite-xl 2.1
local syntax = require "core.syntax"

-- Copied from https://github.com/shanoor/vscode-nginx/blob/master/syntaxes/nginx.tmLanguage

syntax.add {
  name = "Nginx",
  files = { "%.conf$" },
  comment = "#",
  patterns = {
    { pattern = "#.*",             type = "comment"  },
    { pattern = { '"', '"', },     type = "string"   },
    { pattern = { "'", "'", },     type = "string"   },
    { pattern = "[0-9]",           type = "number"   },
    { pattern = "[%a_][%w_]*",     type = "symbol"   },
    { pattern = "%$%w+",           type = "keyword2" }
  },
  symbols = {
    -- constant.language.module.events
    ["events"]    = "keyword",

    -- constant.language.module.http
    ["http"]      = "keyword",

    -- constant.language.directive.module.main
    ["daemon"] = "keyword",
    ["env"] = "keyword",
    ["debug_points"] = "keyword",
    ["error_log"] = "keyword",
    ["log_not_found"] = "keyword",
    ["include"] = "keyword",
    ["lock_file"] = "keyword",
    ["master_process"] = "keyword",
    ["pid"] = "keyword",
    ["ssl_engine"] = "keyword",
    ["timer_resolution"] = "keyword",
    ["types_hash_max_size"] = "keyword",
    ["user"] = "keyword",
    ["worker_cpu_affinity"] = "keyword",
    ["worker_priority"] = "keyword",
    ["worker_processes"] = "keyword",
    ["worker_rlimit_core"] = "keyword",
    ["worker_rlimit_nofile"] = "keyword",
    ["worker_rlimit_sigpending"] = "keyword",
    ["working_directory"] = "keyword",
    ["try_files"] = "keyword",

    -- constant.language.directive.module.events
    ["accept_mutex"] = "keyword",
    ["accept_mutex_delay"] = "keyword",
    ["debug_connection"] = "keyword",
    ["devpoll_changes"] = "keyword",
    ["devpoll_events"] = "keyword",
    ["epoll_events"] = "keyword",
    ["kqueue_changes"] = "keyword",
    ["kqueue_events"] = "keyword",
    ["multi_accept"] = "keyword",
    ["rtsig_signo"] = "keyword",
    ["rtsig_overflow_events"] = "keyword",
    ["rtsig_overflow_test"] = "keyword",
    ["rtsig_overflow_threshold"] = "keyword",
    ["use"] = "keyword",
    ["worker_connections"] = "keyword",

    -- constant.language.directive.module.http
    ["alias"] = "keyword",
    ["chunked_transfer_encoding"] = "keyword",
    ["client_body_in_file_only"] = "keyword",
    ["client_body_buffer_size"] = "keyword",
    ["client_body_temp_path"] = "keyword",
    ["client_body_timeout"] = "keyword",
    ["client_header_buffer_size"] = "keyword",
    ["client_header_timeout"] = "keyword",
    ["client_max_body_size"] = "keyword",
    ["default_type"] = "keyword",
    ["error_page"] = "keyword",
    ["index"] = "keyword",
    ["internal"] = "keyword",
    ["keepalive_timeout"] = "keyword",
    ["keepalive_requests"] = "keyword",
    ["large_client_header_buffers"] = "keyword",
    ["limit_except"] = "keyword",
    ["limit_rate"] = "keyword",
    ["listen"] = "keyword",
    ["location"] = "keyword",
    ["msie_padding"] = "keyword",
    ["msie_refresh"] = "keyword",
    ["optimize_server_names"] = "keyword",
    ["port_in_redirect"] = "keyword",
    ["recursive_error_pages"] = "keyword",
    ["reset_timedout_connection"] = "keyword",
    ["resolver"] = "keyword",
    ["resolver_timeout"] = "keyword",
    ["root"] = "keyword",
    ["satisfy_any"] = "keyword",
    ["send_timeout"] = "keyword",
    ["sendfile"] = "keyword",
    ["server"] = "keyword",
    ["server_name"] = "keyword",
    ["server_names_hash_max_size"] = "keyword",
    ["server_names_hash_bucket_size"] = "keyword",
    ["tcp_nodelay"] = "keyword",
    ["tcp_nopush"] = "keyword",
    ["types"] = "keyword",
    ["try_files"] = "keyword",

    -- constant.language.module.http.addition
    ["add_before_body"] = "keyword",
    ["add_after_body"] = "keyword",
    ["addition_types"] = "keyword",

    -- constant.language.module.http.access
    ["allow"] = "keyword",
    ["deny"] = "keyword",

    -- constant.language.module.http.auth_basic
    ["auth_basic"] = "keyword",
    ["auth_basic_user_file"] = "keyword",

    -- constant.language.module.http.auth_jwt
    ["auth_jwt"] = "keyword",
    ["auth_jwt_header_set"] = "keyword",
    ["auth_jwt_claim_set"] = "keyword",
    ["auth_jwt_key_file"] = "keyword",

    -- constant.language.module.http.autoindex
    ["autoindex"] = "keyword",
    ["autoindex_exact_size"] = "keyword",
    ["autoindex_format"] = "keyword",
    ["autoindex_localtime"] = "keyword",

    -- constant.language.module.http.browser
    ["ancient_browser"] = "keyword",
    ["ancient_browser_value"] = "keyword",
    ["modern_browser"] = "keyword",
    ["modern_browser_value"] = "keyword",

    -- constant.language.module.http.charset
    ["charset"] = "keyword",
    ["charset_map"] = "keyword",
    ["override_charset"] = "keyword",
    ["source_charset"] = "keyword",

    -- constant.language.module.http.empty_gif
    ["empty_gif"] = "keyword",

    -- constant.language.module.http.fastcgi
    ["fastcgi_index"] = "keyword",
    ["fastcgi_hide_header"] = "keyword",
    ["fastcgi_ignore_client_abort"] = "keyword",
    ["fastcgi_intercept_errors"] = "keyword",
    ["fastcgi_param"] = "keyword",
    ["fastcgi_pass"] = "keyword",
    ["fastcgi_pass_header"] = "keyword",
    ["fastcgi_read_timeout"] = "keyword",
    ["fastcgi_redirect_errors"] = "keyword",
    ["fa"] = "keyword",
    ["stcgi_storefastcgi_store_access"] = "keyword",
    ["fastcgi_buffers"] = "keyword",
    ["fastcgi_buffers_size"] = "keyword",
    ["fastcgi_temp_path"] = "keyword",
    ["fastcgi_buffer_size"] = "keyword",
    ["fastcgi_connect_timeout"] = "keyword",
    ["fastcgi_send_timeout"] = "keyword",
    ["fastcgi_split_path_info"] = "keyword",

    -- constant.language.module.http.geo
    ["geo"] = "keyword",

    -- constant.language.module.http.gzip
    ["gzip"] = "keyword",
    ["gzip_buffers"] = "keyword",
    ["gzip_comp_level"] = "keyword",
    ["gzip_disable"] = "keyword",
    ["gzip_http.version"] = "keyword",
    ["gzip_min_length"] = "keyword",
    ["gzip_proxied"] = "keyword",
    ["gzip_types"] = "keyword",
    ["gzip_vary"] = "keyword",
    ["gzip_static"] = "keyword",

    -- constant.language.module.http.headers
    ["add_header"] = "keyword",
    ["expires"] = "keyword",
    ["server_tokens"] = "keyword",

    -- constant.language.module.http.referer
    ["valid_referers"] = "keyword",

    -- constant.language.module.http.limit_zone
    ["limit_zone"] = "keyword",
    ["limit_conn"] = "keyword",

    -- constant.language.module.http.limit_req
    ["limit_req"] = "keyword",
    ["limit_req_log_level"] = "keyword",
    ["limit_req_status"] = "keyword",
    ["limit_req_zone"] = "keyword",

    -- constant.language.module.http.log
    ["access_log"] = "keyword",
    ["log_format"] = "keyword",

    -- constant.language.module.http.map
    ["map"] = "keyword",
    ["map_hash_max_size"] = "keyword",
    ["map_hash_bucket_size"] = "keyword",

    -- constant.language.module.http.memcached
    ["memcached_pass"] = "keyword",
    ["memcached_connect_timeout"] = "keyword",
    ["memcached_send_timeout"] = "keyword",
    ["memcached_read_timeout"] = "keyword",
    ["memcached_buffer_size"] = "keyword",
    ["memcached_next_upstream"] = "keyword",

    -- constant.language.module.http.proxy
    ["proxy_buffer_size"] = "keyword2",
    ["proxy_buffering"] = "keyword2",
    ["proxy_buffers"] = "keyword2",
    ["proxy_busy_buffers_size"] = "keyword2",
    ["proxy_cache"] = "keyword2",
    ["proxy_cache_background_update"] = "keyword2",
    ["proxy_cache_bypass"] = "keyword2",
    ["proxy_cache_convert_head"] = "keyword2",
    ["proxy_cache_key"] = "keyword2",
    ["proxy_cache_lock"] = "keyword2",
    ["proxy_cache_lock_age"] = "keyword2",
    ["proxy_cache_lock_timeout"] = "keyword2",
    ["proxy_cache_max_range_offset"] = "keyword2",
    ["proxy_cache_methods"] = "keyword2",
    ["proxy_cache_min_uses"] = "keyword2",
    ["proxy_cache_path"] = "keyword2",
    ["proxy_cache_purge"] = "keyword2",
    ["proxy_cache_revalidate"] = "keyword2",
    ["proxy_cache_use_stale"] = "keyword2",
    ["proxy_cache_valid"] = "keyword2",
    ["proxy_connect_timeout"] = "keyword2",
    ["proxy_headers_hash_bucket_size"] = "keyword2",
    ["proxy_headers_hash_max_size"] = "keyword2",
    ["proxy_hide_header"] = "keyword2",
    ["proxy_http_version"] = "keyword2",
    ["proxy_ignore_client_abort"] = "keyword2",
    ["proxy_intercept_errors"] = "keyword2",
    ["proxy_max_temp_file_size"] = "keyword2",
    ["proxy_method"] = "keyword2",
    ["proxy_next_upstream"] = "keyword2",
    ["proxy_next_upstream_tries"] = "keyword2",
    ["proxy_next_upstream_timeout"] = "keyword2",
    ["proxy_pass"] = "keyword2",
    ["proxy_pass_header"] = "keyword2",
    ["proxy_pass_request_body"] = "keyword2",
    ["proxy_pass_request_headers"] = "keyword2",
    ["proxy_read_timeout"] = "keyword2",
    ["proxy_redirect"] = "keyword2",
    ["proxy_redirect_errors"] = "keyword2",
    ["proxy_send_lowat"] = "keyword2",
    ["proxy_send_timeout"] = "keyword2",
    ["proxy_set_body"] = "keyword2",
    ["proxy_set_header"] = "keyword2",
    ["proxy_store"] = "keyword2",
    ["proxy_store_access"] = "keyword2",
    ["proxy_temp_file_write_size"] = "keyword2",
    ["proxy_temp_path"] = "keyword2",
    ["proxy_upstream_fail_timeout"] = "keyword2",
    ["proxy_upstream_max_fails"] = "keyword2",
    ["proxy_no_cache"] = "keyword2",

    -- constant.language.module.http.realip
    ["set_real_ip_from"] = "keyword",
    ["real_ip_header"] = "keyword",
    ["real_ip_recursive"] = "keyword",

    -- constant.language.module.http.rewrite
    ["break"] = "keyword",
    ["if"] = "keyword",
    ["return"] = "keyword",
    ["rewrite"] = "keyword",
    ["set"] = "keyword",
    ["uninitialized_variable_warn"] = "keyword",

    -- constant.language.module.http.ssi
    ["ssi"] = "keyword",
    ["ssi_silent_errors"] = "keyword",
    ["ssi_types"] = "keyword",
    ["ssi_value_length"] = "keyword",

    -- constant.language.module.http.upstream
    ["ip_hash"] = "keyword",
    ["upstream"] = "keyword",
    ["server"] = "keyword",

    -- constant.language.module.http.userid
    ["userid"] = "keyword",
    ["userid_domain"] = "keyword",
    ["userid_expires"] = "keyword",
    ["userid_name"] = "keyword",
    ["userid_p3p"] = "keyword",
    ["userid_path"] = "keyword",
    ["userid_service"] = "keyword",

    -- constant.language.module.http.uwsgi
    ["uwsgi_bind"] = "keyword",
    ["uwsgi_buffer_size"] = "keyword",
    ["uwsgi_buffering"] = "keyword",
    ["uwsgi_buffers"] = "keyword",
    ["uwsgi_busy_buffers_size"] = "keyword",
    ["uwsgi_cache"] = "keyword",
    ["uwsgi_cache_background_update"] = "keyword",
    ["uwsgi_cache_bypass"] = "keyword",
    ["uwsgi_cache_key"] = "keyword",
    ["uwsgi_cache_lock"] = "keyword",
    ["uwsgi_cache_lock_age"] = "keyword",
    ["uwsgi_cache_lock_timeout"] = "keyword",
    ["uwsgi_cache_max_range_offset"] = "keyword",
    ["uwsgi_cache_methods"] = "keyword",
    ["uwsgi_cache_min_uses"] = "keyword",
    ["uwsgi_cache_path"] = "keyword",
    ["uwsgi_cache_purge"] = "keyword",
    ["uwsgi_cache_revalidate"] = "keyword",
    ["uwsgi_cache_use_stale"] = "keyword",
    ["uwsgi_cache_valid"] = "keyword",
    ["uwsgi_connect_timeout"] = "keyword",
    ["uwsgi_force_ranges"] = "keyword",
    ["uwsgi_hide_header"] = "keyword",
    ["uwsgi_ignore_client_abort"] = "keyword",
    ["uwsgi_ignore_headers"] = "keyword",
    ["uwsgi_intercept_errors"] = "keyword",
    ["uwsgi_limit_rate"] = "keyword",
    ["uwsgi_max_temp_file_size"] = "keyword",
    ["uwsgi_modifier1"] = "keyword",
    ["uwsgi_modifier2"] = "keyword",
    ["uwsgi_next_upstream"] = "keyword",
    ["uwsgi_next_upstream_timeout"] = "keyword",
    ["uwsgi_next_upstream_tries"] = "keyword",
    ["uwsgi_no_cache"] = "keyword",
    ["uwsgi_param"] = "keyword",
    ["uwsgi_pass"] = "keyword",
    ["uwsgi_pass_header"] = "keyword",
    ["uwsgi_pass_request_body"] = "keyword",
    ["uwsgi_pass_request_headers"] = "keyword",
    ["uwsgi_read_timeout"] = "keyword",
    ["uwsgi_request_buffering"] = "keyword",
    ["uwsgi_send_timeout"] = "keyword",
    ["uwsgi_ssl_certificate"] = "keyword",
    ["uwsgi_ssl_certificate_key"] = "keyword",
    ["uwsgi_ssl_ciphers"] = "keyword",
    ["uwsgi_ssl_crl"] = "keyword",
    ["uwsgi_ssl_name"] = "keyword",
    ["uwsgi_ssl_password_file"] = "keyword",
    ["uwsgi_ssl_protocols"] = "keyword",
    ["uwsgi_ssl_server_name"] = "keyword",
    ["uwsgi_ssl_session_reuse"] = "keyword",
    ["uwsgi_ssl_trusted_certificate"] = "keyword",
    ["uwsgi_ssl_verify"] = "keyword",
    ["uwsgi_ssl_verify_depth"] = "keyword",
    ["uwsgi_store"] = "keyword",
    ["uwsgi_store_access"] = "keyword",
    ["uwsgi_temp_file_write_size"] = "keyword",
    ["uwsgi_temp_path"] = "keyword",

    -- constant.language.directive.module.http
    ["ssl"] = "keyword",
    ["ssl_buffer_size"] = "keyword",
    ["ssl_certificate"] = "keyword",
    ["ssl_certificate_key"] = "keyword",
    ["ssl_ciphers"] = "keyword",
    ["ssl_client_certificate"] = "keyword",
    ["ssl_crl"] = "keyword",
    ["ssl_dhparam"] = "keyword",
    ["ssl_ecdh_curve"] = "keyword",
    ["ssl_password_file"] = "keyword",
    ["ssl_prefer_server_ciphers"] = "keyword",
    ["ssl_protocols"] = "keyword",
    ["ssl_session_cache"] = "keyword",
    ["ssl_session_ticket_key"] = "keyword",
    ["ssl_session_tickets"] = "keyword",
    ["ssl_session_timeout"] = "keyword",
    ["ssl_stapling"] = "keyword",
    ["ssl_stapling_file"] = "keyword",
    ["ssl_stapling_responder"] = "keyword",
    ["ssl_stapling_verify"] = "keyword",
    ["ssl_trusted_certificate"] = "keyword",
    ["ssl_verify_client"] = "keyword",
    ["ssl_verify_depth"] = "keyword",

    ["true"]     = "literal",
    ["false"]    = "literal",
    ["on"]       = "literal",
    ["off"]      = "literal",
    ["all"]      = "literal",
    ["null"]     = "literal"
  },
}