config.json 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. {
  2. "form": [
  3. {
  4. "key": "name",
  5. "type": "string",
  6. "title": "名称",
  7. "placeholder": "输入名称方便辨别",
  8. "required": false
  9. },
  10. {
  11. "key": "match",
  12. "type": "object",
  13. "title": "匹配路径",
  14. "hideHeader": true,
  15. "items": [
  16. {
  17. "type": "select",
  18. "title": "匹配规则",
  19. "option": [
  20. {
  21. "label": "精确匹配",
  22. "value": "="
  23. },
  24. {
  25. "label": "以字符开头",
  26. "value": "^~"
  27. },
  28. {
  29. "label": "正则(区分大小写)",
  30. "value": "~"
  31. },
  32. {
  33. "label": "正则(不区分大小写)",
  34. "value": "~*"
  35. },{
  36. "label": "默认",
  37. "value": ""
  38. }
  39. ],
  40. "required": false,
  41. "key": "regex",
  42. "placeholder": "匹配规则,如=,~^",
  43. "width": 180
  44. },
  45. {
  46. "type": "string",
  47. "title": "路径",
  48. "key": "path",
  49. "placeholder": "请输入路径",
  50. "value": "/",
  51. "width": 300
  52. }
  53. ],
  54. "description": "优选级:精确匹配(=) > 完整路径 > 以字符开头(^~) > 正则顺序(~或者~*) > 部分起始路径(/xx/) > 默认路径(/);\n当有正则时,变量$1,$2为正则中匹配的()内的顺序内容,比如:~ \/(d+)\/([0-9]+),当访问/abc/123时,$1为abc,$2为123"
  55. },
  56. {
  57. "key": "enable",
  58. "title": "启用",
  59. "type": "switch",
  60. "description": "是否启用,如果不启用,将不会渲染该配置"
  61. },
  62. {
  63. "key": "proxy_type",
  64. "title": "代理类型",
  65. "type": "select",
  66. "option": [
  67. {
  68. "label": "反向代理",
  69. "value": "proxy"
  70. },{
  71. "label": "静态资源",
  72. "value": "static"
  73. },{
  74. "label": "其它",
  75. "value": "other"
  76. }],
  77. "cascade": {
  78. "proxy": [
  79. {
  80. "key": "proxy_pass",
  81. "title": "代理地址",
  82. "type": "proxy_pass"
  83. },
  84. {
  85. "key": "proxy_settings",
  86. "title": "更多代理设置",
  87. "type": "proxy_settings",
  88. "required": false,
  89. "description": "更多代理设置"
  90. }
  91. ],
  92. "static": [
  93. {
  94. "key": "index",
  95. "title": "首页",
  96. "required": false,
  97. "type": "select",
  98. "mode": "tags",
  99. "option": ["index.html","index.php","index.htm"],
  100. "description": "nginx静态资源默认的首页文件名,比如index.html index.php"
  101. },
  102. {
  103. "key": "root",
  104. "type": "string",
  105. "title": "根路径",
  106. "required": false,
  107. "description": "静态资源的根路径,查找方式为直接拼接,比如:匹配路径为 /test/ ,root为/data/root,则查找资源的完整路径为:/data/root/test"
  108. },
  109. {
  110. "key": "alias",
  111. "type": "string",
  112. "title": "路径别名",
  113. "required": false,
  114. "description": "alias和root二选一,注意与root的区别,比如:匹配路径为 /test/ ,alias为/data/root,则查找资源的完整路径为:/data/root/"
  115. },
  116. {
  117. "key": "try_files",
  118. "title": "try_files",
  119. "type": "select",
  120. "mode": "tags",
  121. "option": ["$uri","$uri/","/index.html"],
  122. "description": "",
  123. "required": false,
  124. "width": 450
  125. }
  126. ],
  127. "other": [
  128. {
  129. "key": "return",
  130. "title": "return",
  131. "description": "直接返回固定内容",
  132. "type": "object",
  133. "hideHeader": true,
  134. "required": false,
  135. "items": [
  136. {
  137. "key": "code",
  138. "type": "int",
  139. "min": 200,
  140. "max": 600,
  141. "placeholder": "请输入http状态码",
  142. "width": 180
  143. },
  144. {
  145. "key": "content",
  146. "type": "string",
  147. "title": "内容",
  148. "placeholder": "响应内容",
  149. "width": 300
  150. }
  151. ]
  152. }
  153. ]
  154. }
  155. },
  156. {
  157. "key": "cors_setting",
  158. "title": "跨域配置",
  159. "type": "cors",
  160. "description": "跨域配置,可以通过该配置项解决前端跨域问题",
  161. "required": false
  162. },
  163. {
  164. "type": "auth",
  165. "title": "鉴权",
  166. "key": "auth_request",
  167. "required": false,
  168. "description": "ngx_http_auth_request_module:实现了基于一子请求的结果的客户端的授权。如果子请求返回2xx响应码,则允许访问。如果它返回401或403,则访问被拒绝并显示相应的错误代码。子请求返回的任何其他响应代码都被认为是错误的"
  169. },
  170. {
  171. "type": "gzip",
  172. "title": "压缩配置",
  173. "key": "gzip",
  174. "required": false,
  175. "description": "gzip"
  176. },
  177. {
  178. "key": "add_header",
  179. "title": "添加响应头",
  180. "type": "array",
  181. "hideHeader": true,
  182. "description": "添加http响应头",
  183. "required": false,
  184. "items": [
  185. {
  186. "key": "name",
  187. "title": "header名称",
  188. "type": "string",
  189. "width": 180,
  190. "placeholder": "header名称"
  191. },
  192. {
  193. "key": "value",
  194. "title": "header值",
  195. "type": "string",
  196. "placeholder": "header值",
  197. "width": 300
  198. }
  199. ]
  200. },
  201. {
  202. "key": "rewrite",
  203. "type": "object",
  204. "title": "rewrite",
  205. "required": false,
  206. "description": "rewrite:对访问路径进行,放在server{}, if{},location{}段中,rewrite < regex > < replacement > [flag], 必须填写正则表达式和跳转路径才能生效",
  207. "items": [
  208. {
  209. "key": "regex",
  210. "title": "正则表达式",
  211. "type": "string",
  212. "width": 180,
  213. "description": "必须填写正则表达式和跳转路径才能生效"
  214. },
  215. {
  216. "key": "replacement",
  217. "title": "跳转路径",
  218. "type": "string",
  219. "placeholder": "跳转后的内容",
  220. "width": 300
  221. },
  222. {
  223. "width": 120,
  224. "key": "flag",
  225. "title": "flag",
  226. "type": "select",
  227. "option": ["last","break","redirect","permanent"],
  228. "description": "last: 相当于Apache的【L】标记,表示完成rewrite;\nbreak:本条规则匹配完成即终止,不在匹配后面的任何规则;\nredirect: 返回302临时重定向,浏览器地址栏会显示跳转后的URL地址,爬虫不会更新url;\npermanent:返回301永久重定向,浏览器地址栏会显示跳转后的URL地址,爬虫更新url;"
  229. }
  230. ]
  231. },
  232. {
  233. "key": "tmp_custom_config",
  234. "title": "自定义配置",
  235. "type": "textarea",
  236. "hideHeader": true,
  237. "description": "自定义配置,注意,每行结尾需要加“;”号,将会拼接在最后",
  238. "required": false,
  239. "trim": false
  240. },
  241. {
  242. "key": "internal",
  243. "title": "内部路由",
  244. "type": "switch",
  245. "description": "内部路由:nginx内部访问,一旦出了这个配置文件,则失效"
  246. },
  247. {
  248. "key": "error_page",
  249. "title": "错误页面",
  250. "type": "error_page",
  251. "required": false,
  252. "description": "错误页面配置"
  253. },
  254. {
  255. "key": "default_type",
  256. "title": "默认内容类型",
  257. "type": "string",
  258. "required": false,
  259. "description": "default_type eg. text/plain application/json"
  260. },
  261. {
  262. "key": "remark",
  263. "title": "备注信息",
  264. "type": "textarea",
  265. "rows": 3,
  266. "placeholder": "输入备注信息",
  267. "required": false,
  268. "trim": false,
  269. "width": 600
  270. }
  271. ]
  272. }