Welcome! Log In Create A New Profile

Advanced

Re: checking headers

Francis Daly
May 31, 2016 09:48AM
On Tue, May 31, 2016 at 09:23:36AM -0400, Larry Martell wrote:
> On Tue, May 31, 2016 at 7:55 AM, Larry Martell <larry.martell@gmail.com> wrote:
> >>> On Sat, May 28, 2016 at 12:48 PM, Larry Martell <larry.martell@gmail.com>
> >>> wrote:

Hi there,

> >>>> Is there any way with nginx to check a request's headers and send back
> >>>> a 401 if the headers are not proper?

> > Looking with tcpdump I do not see that header field set. The request
> > is coming from a django app which is doing a redirect and I set the
> > header before the redirect. Guess I have to debug from that side.
>
> I traced the django code all the way through to when the response is
> going out and I see this:
>
> (Pdb) response._headers
> {'x-capdata-auth': ('X-Capdata-Auth', 'authorized'), 'content-type':
> ('Content-Type', 'text/html; charset=utf-8'), 'location': ('Location',
> 'http://foo.bar.com:8000/workitem/12345'), 'vary': ('Vary', 'Cookie')}
>
> Any one have any ideas as to why it doesn't seem to make it over to nginx?

There is a request from the client to nginx.

There is a response from nginx to the client.

There can be a request from nginx to its upstream, and a response from
upstream to nginx.

Any of those requests and responses can include headers.

In your architecture, what "header" do you care about?

That should tell you which variable value to check.

http://nginx.org/r/$http_

http://nginx.org/r/$sent_http_

http://nginx.org/r/$upstream_http_

are three different families of variables set within nginx.

Possibly one of them covers what you want?

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

checking headers

Larry Martell May 28, 2016 03:50PM

Re: checking headers

Robert Paprocki May 30, 2016 02:20PM

Re: checking headers

Larry Martell May 31, 2016 07:44AM

Re: checking headers

Larry Martell May 31, 2016 07:58AM

Re: checking headers

Larry Martell May 31, 2016 09:26AM

Re: checking headers

Francis Daly May 31, 2016 09:48AM

Re: checking headers

Larry Martell May 31, 2016 10:28AM

Re: checking headers

Francis Daly May 31, 2016 11:40AM

Re: checking headers

Larry Martell May 31, 2016 12:36PM

Re: checking headers

Francis Daly May 31, 2016 04:22PM

Re: checking headers

Larry Martell May 31, 2016 04:50PM

Re: checking headers

Francis Daly May 31, 2016 07:08PM

Re: checking headers

Larry Martell June 01, 2016 04:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 273
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