| # VHost exposing an API for Gateway Tracking Service ( GTS ) to control the Gateway |
| # This VHost should listen on a PORT that is never exposed externally |
| # This VHost should use a server_name matching the hostname |
| |
| server { |
| listen 5000 default_server; |
| |
| # |
| # Sample message to start tracking requests that match with the given format |
| # { |
| # "id": 222, |
| # "domain" : "cc-eco;cceco-consumer;*", |
| # "format": "$publisher_org_name;$consumer_org_name;$api_key", |
| # "expire_at_utc": 1408065588, |
| # "action" : "track", |
| # "data" : 0 |
| # } |
| # |
| location /tracking { |
| access_log /var/log/api-gateway/access.log; |
| limit_except POST { |
| deny all; |
| } |
| content_by_lua 'ngx.apiGateway.tracking.POST_HANDLER()'; |
| } |
| |
| # |
| # location returning all TRACKing rules |
| # |
| location /tracking/track { |
| access_log /var/log/api-gateway/access.log; |
| limit_except GET { |
| deny all; |
| } |
| default_type 'application/json'; |
| content_by_lua 'ngx.apiGateway.tracking.GET_HANDLER("TRACK")'; |
| } |
| |
| # |
| # location retuning all BLOCKing rules |
| # |
| location /tracking/block { |
| access_log /var/log/api-gateway/access.log; |
| limit_except GET { |
| deny all; |
| } |
| default_type 'application/json'; |
| content_by_lua 'ngx.apiGateway.tracking.GET_HANDLER("BLOCK")'; |
| } |
| |
| # |
| # location returning all DELAYing rules |
| # |
| location /tracking/delay { |
| access_log /var/log/api-gateway/access.log; |
| limit_except GET { |
| deny all; |
| } |
| default_type 'application/json'; |
| content_by_lua 'ngx.apiGateway.tracking.GET_HANDLER("DELAY")'; |
| } |
| |
| # |
| # location returning all REWRITE rules |
| # |
| location /tracking/rewrite { |
| limit_except GET { |
| deny all; |
| } |
| default_type 'application/json'; |
| content_by_lua 'ngx.apiGateway.tracking.GET_HANDLER("REWRITE")'; |
| } |
| } |