Welcome! Log In Create A New Profile

Advanced

RE: How do I add text to a response from a remote URL in NGINX?

Reinis Rozitis
September 01, 2020 09:56AM
> > Now instead you want the content of the url
> > http://externalserver.com/before_body.txt?
>
> Yes, that's right.

Can you actually open the file on the external server - http://externalserver.com/src/before_body.txt and does it have the content you expect (without redirects)?

Note that since you have proxy_pass without the trailing slash nginx will send the request as '/src/before_body.txt'.

If there is no such /src/ directory on the remote server but only /before_body.txt then you have to add the slash at the end:

location /src/ {
proxy_pass http://externalserver.com/;
}

rr

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

How do I add text to a response from a remote URL in NGINX?

moyamos August 31, 2020 03:49AM

RE: How do I add text to a response from a remote URL in NGINX?

Reinis Rozitis August 31, 2020 09:24AM

Re: RE: How do I add text to a response from a remote URL in NGINX?

moyamos September 01, 2020 01:12AM

Re: How do I add text to a response from a remote URL in NGINX?

Francis Daly September 01, 2020 07:08AM

Re: How do I add text to a response from a remote URL in NGINX?

moyamos September 01, 2020 08:40AM

RE: How do I add text to a response from a remote URL in NGINX?

Reinis Rozitis September 01, 2020 09:56AM

Re: How do I add text to a response from a remote URL in NGINX?

Francis Daly September 01, 2020 09:58AM

Re: How do I add text to a response from a remote URL in NGINX?

moyamos September 02, 2020 09:11AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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