1- ![ ] ( https://img.shields.io/badge/version-0.3 .0-brightgreen )
1+ ![ ] ( https://img.shields.io/badge/version-0.4 .0-brightgreen )
22
33# go-ngx-config
44A nginx config parser
@@ -107,16 +107,73 @@ go-ngx-config lt -f <NGINX_CONF_FILE> -u <URL_TARGET>
107107 ]
108108 },
109109 {
110- "Name" : " location" ,
111- "Modifier" : " =" ,
112- "Match" : " /favicon.ico" ,
113- "Directives" : [
110+ "Block" : null ,
111+ "Name" : " include" ,
112+ "Parameters" : [
113+ " conf-includes/proxy.conf"
114+ ],
115+ "IncludePath" : " conf-includes/proxy.conf" ,
116+ "Configs" : [
114117 {
115- "Block" : null ,
116- "Name" : " root" ,
117- "Parameters" : [
118- " html"
119- ]
118+ "Directives" : [
119+ {
120+ "Block" : null ,
121+ "Name" : " proxy_set_header" ,
122+ "Parameters" : [
123+ " Host" ,
124+ " $host"
125+ ]
126+ }
127+ ],
128+ "Filepath" : " examples/basic/conf-includes/proxy.conf"
129+ }
130+ ]
131+ },
132+ {
133+ "Block" : null ,
134+ "Name" : " include" ,
135+ "Parameters" : [
136+ " handlers/*.conf"
137+ ],
138+ "IncludePath" : " handlers/*.conf" ,
139+ "Configs" : [
140+ {
141+ "Directives" : [
142+ {
143+ "Name" : " location" ,
144+ "Modifier" : " =" ,
145+ "Match" : " /my-be-service" ,
146+ "Directives" : [
147+ {
148+ "Block" : null ,
149+ "Name" : " proxy_pass" ,
150+ "Parameters" : [
151+ " http://be-service"
152+ ]
153+ }
154+ ]
155+ }
156+ ],
157+ "Filepath" : " examples/basic/handlers/be.conf"
158+ },
159+ {
160+ "Directives" : [
161+ {
162+ "Name" : " location" ,
163+ "Modifier" : " =" ,
164+ "Match" : " /my-fe-service" ,
165+ "Directives" : [
166+ {
167+ "Block" : null ,
168+ "Name" : " proxy_pass" ,
169+ "Parameters" : [
170+ " http://fe-service"
171+ ]
172+ }
173+ ]
174+ }
175+ ],
176+ "Filepath" : " examples/basic/handlers/fe.conf"
120177 }
121178 ]
122179 },
@@ -127,9 +184,17 @@ go-ngx-config lt -f <NGINX_CONF_FILE> -u <URL_TARGET>
127184 "Directives" : [
128185 {
129186 "Block" : null ,
130- "Name" : " root " ,
187+ "Name" : " add_header " ,
131188 "Parameters" : [
132- " html"
189+ " 'x-foo'" ,
190+ " 'x-bar'"
191+ ]
192+ },
193+ {
194+ "Block" : null ,
195+ "Name" : " proxy_pass" ,
196+ "Parameters" : [
197+ " http://my-upstream"
133198 ]
134199 }
135200 ]
@@ -152,7 +217,9 @@ go-ngx-config lt -f <NGINX_CONF_FILE> -u <URL_TARGET>
152217 "Name" : " include" ,
153218 "Parameters" : [
154219 " mime.types"
155- ]
220+ ],
221+ "IncludePath" : " mime.types" ,
222+ "Configs" : null
156223 },
157224 {
158225 "Block" : null ,
@@ -215,6 +282,6 @@ server {
215282## TODO(s):
216283- [x] .wasm binary
217284- [x] Location Tester
218- - [ ] Include directive and reads the glob (?)
285+ - [x ] Include directive and reads the glob
219286- [ ] HTTP Server for see the config on UI browser
220287- [ ] And lot more...
0 commit comments