nginx-java-parser
nginx-java-parser copied to clipboard
Nginx configuration parser based on ANTLR4 grammar
The parser cannot parse rewrite rules defining `()` in a character group. Example: `rewrite ^/d/([A-Za-z0-9-,():!½$@*°'"—%]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ /d?displayName=$1&module=$2&id=$3&visibility=$4;` Changing `()` to `)(` works around this issue.
When we read config and dump the config into another file, parenthesis will be missed from IF block
For Ex: If I have nginx.conf file as follow: http { #use epoll; server { server_name abc.com; listen 443; if ($host = abc.com) { return 404; } location ~ /hello/...
user root; http { server { proxy_redirect ~^(http://[^:]+):\d+(/.+)$ $1$2; } } 
Add wirteTo(File) function in NgxConfig to add some configuration from java object ,for that i can re-config nginx dynamically
Take this perl function which should strip a password out of the url: ``` perl_set $strippw ' sub { my $r = shift; my $uri = $r->uri; return $uri if...
This is a valid nginx token replacement: `` The parser fails to recognize it and gives an error (the resulting AST lacks the .
``` http { upstream myproject { server 172.17.0.5:80 weight=3; server 172.17.0.6:80 weight=1; } server { listen 80; location / { proxy_pass http://myproject; } } } ```
This changes the generated manifest to be OSGi compliant. declaring all imported and exported packages. No other changes in any of the compiled classes ``` Manifest-Version: 1.0 Bnd-LastModified: 1460299170325 Build-Jdk:...
``` location ~* (^.+\.(xhtml)(;.?)){ proxy_pass http://server; } ``` error mseeage ``` line 1:18 missing ')' at '(' ```