Welcome! Log In Create A New Profile

Advanced

Re: Nginx - API Gateway is not forwarding the request to Auth Service

April 11, 2017 02:04AM
Hi Maxim,

Thanks for the response.

As you said below,

> Instead, it issues a
> subrequest for every incoming request, and allows further
> processing of the request if and only if the subrequest returns
> 200.

This means my authentication service will be getting a subrequest to /login everytime a request reaches nginx. And if the subrequest returns 401 then it means the user needs to login. So kindly help me that how can I show a login page if a subrequest throws 401 ? My authentication service is sending a redirect in response alongwith the 401 status?

When I access my authentication service directly from browser without a logged-in session id, my browser is getting a 401 with redirect to /login which is login page. I want this same behaviour in my NGINX API gateway i.e. NGINX sends each request to API gateway if the request needs to be logged in a login page should be shown otherwise let the request access the resource. And I followed the nginx auth_request user guide to configure this as I showed my config in first thread.
Subject Author Posted

Nginx - API Gateway is not forwarding the request to Auth Service

zaidahmd April 10, 2017 04:42AM

Re: Nginx - API Gateway is not forwarding the request to Auth Service

Maxim Dounin April 10, 2017 08:14AM

Re: Nginx - API Gateway is not forwarding the request to Auth Service

zaidahmd April 11, 2017 02:04AM

Re: Nginx - API Gateway is not forwarding the request to Auth Service

zaidahmd April 11, 2017 03:51AM

Re: Nginx - API Gateway is not forwarding the request to Auth Service

Francis Daly April 11, 2017 07:50AM

Re: Nginx - API Gateway is not forwarding the request to Auth Service

zaidahmd April 12, 2017 05:50AM

Re: Nginx - API Gateway is not forwarding the request to Auth Service

Francis Daly April 12, 2017 05:46PM

Re: Nginx - API Gateway is not forwarding the request to Auth Service

zaidahmd April 13, 2017 01:00AM

Re: Nginx - API Gateway is not forwarding the request to Auth Service

Francis Daly April 13, 2017 07:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 242
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready