This repository has been archived by the owner on Aug 28, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
nginx_apikey_access_filter_module | ||
================================= | ||
|
||
Nginx filter to restrict the access at your backend APIs | ||
|
||
Status | ||
====== | ||
|
||
This module is under active development and is production ready. | ||
|
||
Synopsis | ||
======== | ||
|
||
server { | ||
|
||
... | ||
|
||
# let's filter all the requests to our backend API s(i.e. a tornado web app) | ||
location ~* \.do$ { | ||
|
||
# enable the apikey access filter | ||
apikey_access_filter on; | ||
|
||
# set the connection string for the client_id / client_secret provider | ||
apikey_access_filter_dburl "mysql://apikeyadmin:apikeyadmin@127.0.0.1:3306/APIKEYS"; | ||
|
||
# common reverse proxy config (i.e. for tornado) | ||
proxy_pass_header Server; | ||
proxy_set_header Host $http_host; | ||
proxy_redirect off; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Scheme $scheme; | ||
proxy_pass http://backends; | ||
} | ||
|
||
... | ||
} |