Skip to content

b-rajesh/nginx-plus-oidc-relyingparty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

diy-nginx-plus-api-gateway - build a opinionated APIGateway

Pre-requisites

Obtain the NGINX Plus license :

   1. If you are planning to run nginx plus as apigateway then copy nginx plus license nginx-repo.crt & nginx-repo.key to /etc/ssl/nginx/
   2. If you are planning to run nginx oss as apigateway then you don't need nginx plus license, however you will have to inspect the conf files inside to remove 
   certain directive which pertains to nginx plus. I have highlighted those directives with comments in the conf files.

Run NGINX Plus docker container

Build an image from your Dockerfile :

# To build the Docker image : Run command from the folder containing the `Dockerfile`
$ docker build -t nplus-gateway-relyingparty .
# If you made changes to the Dockerfile and need to rebuild you probably need to use--no-cache
$ docker build -t nplus-gateway-relyingparty . --no-cache

Start the Nginx Plus container :

# Start a new container and publish container ports 80 (HTTP), 443 (HTTPS), 8000 (Demo instructions) and 8080 (NGINX Plus Dashboard) to the host
$ docker run --name mynginxplus_simple  -p 80:80 -p 443:443 -p 8080:8080 -p 8000:8000 -p 9000:9000 -d nplus-gateway-relyingparty

Access NGiNX Plus Dashbaord :

# Open your favourite dashboard and enter the below url
$ http://localhost:8080/dashboard.html
$ Aug…eam/hello-nginxplus docker run -p 3600:8080 --rm -t brajesh79/http-https-echo

Start testing the deployed API :

# [If you're using httpie] Main API traffic flowing through port 80. 
$ http :/warehouse-api/inventory
$ http :/warehouse-api/pricing
# [If you're using curl] Main API traffic flowing through port 80.
$ curl http://localhost/warehouse-api/inventory
$ curl http://localhost/warehouse-api/pricing

Start testing the default API comes with NGiNX Plus API Gateway :

# [If you're using httpie] Main API traffic flowing through port 80. 
$ http :8080/api/6/nginx
$ http :8080/api/6/http/upstreams
# [If you're using curl] Main API traffic flowing through port 80.
$ curl http://localhost:8080/api/6/nginx
$ curl http://localhost:8080/api/6/http/upstreams

Docker commands to clean the nginx-plus containers and images create abvoe :

# To list nginxplus running container
$ docker ps | grep mynginxplus_simple

# To stop the nginxplus running container
$ docker stop | docker ps | grep mynginxplus_simple

# To remoe  the nginxplus iamge
$ docker rmi nplus-gateway-relyingparty

What's in the folder structure

alt text

Policies folder structure

alt text

About

To create OIDC RP using NGINX Plus

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published