Welcome! Log In Create A New Profile

Advanced

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

October 03, 2012 05:00PM
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.

Thanks!
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: 228
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