Welcome! Log In Create A New Profile

Advanced

Proxy_pass with decode_base64 result

November 25, 2013 05:57AM
Hello,

I have a problem with my configuration and i need your help please ;)

I have the following URL that points to my nginx : http://blablabla/folder/cmm/200/aHR0cDovL2F6MjMyNjIudm8ubXNlY25kLm5ldC90cGltYWdlcy81OGE0NTVlNjYzYzNmYmM2OWMwYThjMTJlMGIwYzllOF9taW5pXzguanBn.jpg

I need to extract the following section (it's Ok): aHR0cDovL2F6MjMyNjIudm8ubXNlY25kLm5ldC90cGltYWdlcy81OGE0NTVlNjYzYzNmYmM2OWMwYThjMTJlMGIwYzllOF9taW5pXzguanBn

Then do a decode_base64 of this string extracted (it's Ok): http://az23262.vo.msecnd.net/tpimages/58a455e663c3fbc69c0a8c12e0b0c9e8_mini_8.jpg

And for finish, do a proxy_pass to this new URL (with addition in the cache)

****************** Here is my code ***********

location /folder {
if ( $uri ~ "^/folder/cmm/200/(.*)\.jpg" ) {
set $filename $1;
set_decode_base64 $url_partenaire $filename;
#echo "$url_partenaire"; => print : http://az23262.vo.msecnd.net/tpimages/58a455e663c3fbc69c0a8c12e0b0c9e8_mini_8.jpg
proxy_pass "$url_partenaire";

however I'm stuck at this stage now

******************* error_log nginx ******************

2013/11/25 11:50:02 [error] 29705#0: *5 no resolver defined to resolve az23262.vo.msecnd.net, client: 10.200.12.119, server: blablabla, request: "GET /folder/cmm/200/aHR0cDovL2F6MjMyNjIudm8ubXNlY25kLm5ldC90cGltYWdlcy81OGE0NTVlNjYzYzNmYmM2OWMwYThjMTJlMGIwYzllOF9taW5pXzguanBn.jpg HTTP/1.1", host: "blablabla", referrer: "http://blablabla/folder/cmm/200/aHR0cDovL2F6MjMyNjIudm8ubXNlY25kLm5ldC90cGltYWdlcy81OGE0NTVlNjYzYzNmYmM2OWMwYThjMTJlMGIwYzllOF9taW5pXzguanBn.jpg"



Thank you for your help
Subject Author Posted

Proxy_pass with decode_base64 result

Jugurtha November 25, 2013 05:57AM

Re: Proxy_pass with decode_base64 result

Jugurtha November 27, 2013 10:10AM

Re: Proxy_pass with decode_base64 result

Francis Daly November 27, 2013 06:16PM

Re: Proxy_pass with decode_base64 result

Jugurtha November 28, 2013 03:10AM

Re: Proxy_pass with decode_base64 result

Francis Daly November 28, 2013 04:10AM

Re: Proxy_pass with decode_base64 result

Jugurtha November 29, 2013 07:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready