Welcome! Log In Create A New Profile

Advanced

Re: Proxy pass set body on if

Francis Daly
February 22, 2021 01:14PM
On Mon, Feb 22, 2021 at 07:52:04AM -0500, sanflores wrote:

Hi there,

> This would be great, but I don't know how to server the context from nginx
> with a rewrite, what would work is:

I'm afraid I don't fully understand what response you want to send to
what request.

Can you show some examples?

For example, if you issue the "curl" GET commands

curl -i -H X-Bot:yes http://localhost/one
curl -i -H X-Bot:no http://localhost/one

(let's pretend that you decide bot-or-not based on the X-Bot request
header), then what response do you want in each case?

http 200 with the content of a specific file on the filesystem; http 301
with a redirect to another location; the response from a proxy_pass to
an upstream server; something else?

And if you issue the "curl" POST commands

curl -i -d the_post_data -H X-Bot:yes http://localhost/two
curl -i -d the_post_data -H X-Bot:no http://localhost/two

what response do you want in each case?


(The answer to the question in the Subject: is "you don't" --
http://nginx.org/r/proxy_set_body says "Context: http, server, location",
which does not include "if" or "if in location". So now we are trying
to find your overall requirements, hopefully to make it clear what the
appropriate nginx config is.)

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Proxy pass set body on if

sanflores February 16, 2021 10:00AM

Re: Proxy pass set body on if

Francis Daly February 21, 2021 10:56AM

Re: Proxy pass set body on if

sanflores February 22, 2021 07:52AM

Re: Proxy pass set body on if

Francis Daly February 22, 2021 01:14PM

Re: Proxy pass set body on if

sanflores February 22, 2021 02:15PM

Re: Proxy pass set body on if

Francis Daly February 22, 2021 04:12PM

Re: Proxy pass set body on if

sanflores February 23, 2021 04:56AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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