A helper script for updating the directive definitions in crossplane.analyzer.DIRECTIVES.
make install
This script downloads the latest nginx release tarball, unpacks it, and searches the source code for each directive's definition bitmask. This is very convenient for NGINX OSS directives, but not for NGINX+ directives.
You should just be able to run the script and copy-paste the output into the crossplane/analyzer.py file.
crossplane-update
The dict output from the script above should end with a bunch of empty lists for directives that were not in the NGINX OSS source code. For each of these directives you should do this process:
-
Find the directive in http://nginx.org/en/docs/dirindex.html and follow the link to its documentation.
-
Find the context bitmask(s). Use this table to determine which to use:
Context Bitmask(s) any NGINX_ANY_CONFmain (/http/ in url) NGX_HTTP_MAIN_CONFmain (/mail/ in url) NGX_MAIL_MAIN_CONFmain (/stream/ in url) NGX_STREAM_MAIN_CONFmain NGX_MAIN_CONFserver (/http/ in url) NGX_HTTP_SRV_CONFserver (/mail/ in url) NGX_MAIL_SRV_CONFserver (/stream/ in url) NGX_STREAM_SRV_CONFserver `NGX_HTTP_SRV_CONF upstream (/http/ in url) NGX_HTTP_UPS_CONFupstream (/stream/ in url) NGX_STREAM_UPS_CONFupstream `NGX_HTTP_UPS_CONF http NGX_HTTP_MAIN_CONFmail NGX_MAIL_MAIN_CONFstream NGX_STREAM_MAIN_CONFevents NGX_EVENT_CONFlocation NGX_HTTP_LOC_CONFif `NGX_HTTP_SIF_CONF if in server NGX_HTTP_SIF_CONFif in location NGX_HTTP_LIF_CONFlimit_except NGX_HTTP_LMT_CONF -
Find the syntax bitmask(s). If the answer here is ambiguous, then check to see if there's a similar directive and do it the same way. Usually it will be pretty straight-forward though. This table should be helpful for determining the appropriate bitmask(s):
Bitmask(s) Meaning NGINX_CONF_NOARGSThe directive takes no arguments. NGX_CONF_TAKE1The directive takes exactly 1 argument. NGX_CONF_TAKE2The directive takes exactly 2 arguments. NGX_CONF_TAKE3The directive takes exactly 3 arguments. NGX_CONF_TAKE4The directive takes exactly 4 arguments. NGX_CONF_TAKE5The directive takes exactly 5 arguments. NGX_CONF_TAKE6The directive takes exactly 6 arguments. NGX_CONF_TAKE7The directive takes exactly 7 arguments. NGX_CONF_TAKE12The directive takes 1 or 2 arguments. NGX_CONF_TAKE13The directive takes 1 or 3 arguments. NGX_CONF_TAKE23The directive takes 2 or 3 arguments. NGX_CONF_TAKE123The directive takes between 1 and 3 arguments. NGX_CONF_TAKE1234The directive takes between 1 and 4 arguments. NGX_CONF_BLOCKThe directive is a block directive. NGX_CONF_FLAGThe directive takes 1 argument that is "on" or "off". NGX_CONF_ANYThe directive takes any amount of arguments. NGX_CONF_1MOREThe directive takes 1 or more arguments. NGX_CONF_2MOREThe directive takes 2 or more arguments.