Welcome! Log In Create A New Profile

Advanced

Re: How to tell Proxy module to retrieve secondary URL if primary URL doenst exist

Maxim Dounin
October 04, 2012 05:46AM
Hello!

On Wed, Oct 03, 2012 at 05:00:39PM -0400, wurb32 wrote:

> Hi all,
>
> I am using nginx's Proxy module to retrieve images from Amazon S3. I need to
> be able to tell the Proxy module to retrieve a smaller sized file if a
> bigger sized file doesnt exist. How can I do that?
>
> For instance, my nginx configuration:
>
> location / {
> proxy_pass https://s3.amazonaws.com/my_bucket/;
> error_page 415 = /empty;
> }
>
> Say I have image1_100.jpg on S3 then http://localhost/image1_100.jpg works
> fine. However http://localhost/image1_300.jpg wont work. I want to be able
> to ask nginx to request the
> https://s3.amazonaws.com/my_bucket/image1_300.jpg file and if it doesnt
> exist, request for iamge1_100.jpg file instead.

Use error_page 404 and proxy_intercept_errors, see
http://nginx.org/r/proxy_intercept_errors.

--
Maxim Dounin
http://nginx.com/support.html

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

How to tell Proxy module to retrieve secondary URL if primary URL doenst exist

wurb32 October 03, 2012 05:00PM

Re: How to tell Proxy module to retrieve secondary URL if primary URL doenst exist

Maxim Dounin October 04, 2012 05:46AM

Re: How to tell Proxy module to retrieve secondary URL if primary URL doenst exist

wurb32 October 04, 2012 12:08PM

Re: How to tell Proxy module to retrieve secondary URL if primary URL doenst exist

Maxim Dounin October 05, 2012 08:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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