Welcome! Log In Create A New Profile

Advanced

Re: Nginx reverse proxy redirect

Francis Daly
August 13, 2020 04:46AM
On Wed, Aug 12, 2020 at 02:16:50AM -0400, Dr_tux wrote:

Hi there,

> I have a Nginx reverse proxy. How can I redirect it to the real server URL
> when I download mp3 files in the reverse proxy.

Make a location{} that handles mp3-file requests, and "return 301"
(or otherwise redirect) there.

> normal reverse proxy request goes to backend node, but If the url contains
> mp3, it redirects to another server.

You have something like

location [normal reverse proxy request] {
proxy_pass [somewhere]
}

Add

location [mp3 request] {
return 301 [somewhere else]
}

Fill in the bits in [square brackets] appropriately.

Depending on the full set of requirements, "~ mp3" or "~ mp3$" might be
a useful value for [mp3 request].

Good luck with it,

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

Nginx reverse proxy redirect

Dr_tux August 12, 2020 02:16AM

Re: Nginx reverse proxy redirect

Francis Daly August 13, 2020 04:46AM

Re: Nginx reverse proxy redirect

Dr_tux August 13, 2020 05:50PM

Re: Nginx reverse proxy redirect

Francis Daly August 14, 2020 09:36AM

Re: Nginx reverse proxy redirect

Dr_tux August 31, 2020 06:10AM



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