Anonymize Amazon public URL, decode using a script on Nginx

I have been wondering if its possible to anonymize public URL. When user makes a request with this anonymized public URL, let Nginx decode, fetch and serve the URL.

Example

Public URL http://amazon.server.com/location/file.html

Anonymized URL https://amazon.server.com/09872340-932872389-390643289/983724.html

Nginx decodes 09872340-932872389-390643289/983724.html to location/file.html

Added image below for further clarification. Nginx has a reverse logic to decode, whereas Remote Server has the logic to Anonymize URL.

Anonymize Amazon public URL, decode using a script on Nginx

Question All I need to know is how would Nginx decode anonymized URL? Nginx got anonymized URL request. There has to be a way to decode it.

-------------Problems Reply------------

Define Anonymize for a URL? You can use any of the same methods as URL shortners such as http://bitly.com. But that is not truely anonymous since there is a definite mapping between the shortened URL and the target public url. If you make this per user based there is still a mapping but it is user based.

Looks like what you are suggesting is a variation on the above scheme where instead of sending the user to the target URL via a redirect you want the your server to actually fetch the content and return to the user. You need to be aware of the linked content in the public URL such as style sheets and images and adjust them accordingly. Many of the standard proxies has this kind of functionality built in. Also take a look at

https://github.com/jenssegers/php-proxy

http://search.cpan.org/~book/HTTP-Proxy-0.304/lib/HTTP/Proxy.pm.

If you are planning to build your own these can serve as a base.

I think what you want to do here is somewhat similar to another question I've answered in the past, where for each request by the client, you effectively want to make two requests to two different upstreams under the hood (first one to an upstream capable of decoding the URL, second one to actually fetch said decoded URL), but, of course, only return one result.

http://serverfault.com/questions/202011/nginx-and-2-upstreams/485044#485044

As mentioned on serverfault, you could use error_page to process another request, after the first one is complete. You could then use $upstream_http_ to make the subsequent request based on the original one, for example, using $upstream_http_location.

You might also want to look into X-Accel-Redirect header, introduced in this context at proxy_ignore_headers.

Category:java Views:10 Time:2019-02-13

Related post

  • opening an url in using java script in self window 2011-02-07

    <SCRIPT language="JavaScript1.2"> function openwindow() { window.open("http://www.javascript-coder.com","mywindow","menubar=1,resizable=1,width=350,height=250"); } </SCRIPT> <P> <A href="javascript: openwindow()">Open the Java

  • How do I decode a URL parameter using c#? 2009-09-10

    How can I decode an encoded URL parameter using C#? For example take this url my.aspx?val=%2Fxyz2F ? --------------Solutions------------- Server.UrlDecode(xxxxxxxx) Have you tried HttpServerUtility.UrlDecode or HttpUtility.UrlDecode? string decodedUr

  • How to get data(json array) of facebook public photo by using photo url? 2012-02-18

    I want to get details of public photo of any user's facebook account. here is my image url : http://www.facebook.com/photo.php?fbid=346729048691589&set=a.346719012025926.83282.100000634900314&type=1&l=f48e02a2e3&permPage=1 and i want

  • How to keep same stylesheets and scripts url for seo friendly and non friendly url's using php 2010-08-07

    I am using php to develop an application, i have different set of url's if seo is enabled and different set if seo is disabled. ex: SEO Enabled = hxxp://www.website.com/page/about_us SEO Disabled = hxxp://www.website.com/page.php?about_us Stylesheet

  • Why would Apache be URL decoding my query string? 2009-01-14

    My Web host has refused to help me with this, so I'm coming to the wise folks here for some help "black-box debugging". Here's an edited version of what I sent to them: I have two (among other) domains at dreamhost: 1) thefigtrees.net 2) shouldivotef

  • URL Encoding using C# 2009-02-22

    I have an application which I've developed for a friend. It sends a POST request to the VB forum software and logs someone in (with out setting cookies or anything). Once the user is logged in I create a variable that creates a path on their local ma

  • i got the url value using request.getHeader("Referer"), How to get the parameter values? 2009-07-14

    I need to split out parameters given a URL string. I got the url value using request.getHeader("Referer") e.g.: string rr=request.getHeader("Referer"); <%= rr %> i got the url as http://www.sun.com/questions?uid=21&value=gg Now I stored tha

  • public URLs for common resources 2011-03-08

    I have been told that a great way to decrease the load on my own site is pointing known CSS and JS to public URLs. For instance, JQuery or Blueprint. This allows caching as it is very possible that the user has visited previously other page pointing

  • Client side s3 upload and returning the public url of the image 2011-08-10

    I am writing a client side image uploader library for python. I need to upload an image to Amazon S3 and return the public URL of the image. I can do this using BOTO however I have to share my Secret Key which is not the correct way of doing it. As a

  • Using mootools scripts with gwt application 2011-08-31

    My problem is make an animation on Composite which is started when data is loading. I made animation on normal divs for tests using html: <div class="LoadDataWidget"> <div id="arrow" class="greenArrow"></div> </div> .LoadDataW

  • I have a public URL for an iCloud file, how can I get the DIRECT link to download in iOS? 2011-10-16

    I am able to generate public URLs for iCloud files. e.g. https://www.icloud.com/documents/dl/?p=3&t=BAKsXkcDP-p8sdTS8NgBLWRQxE281oe4hogA Accessing such a URL from a browser, I see a landing page, and shorty afterwards the file downloads automatic

  • UTF-8 URL Decode / Encode 2011-11-16

    I instruct my URL to send an Ajax request like that: url += '/' + something + '/' + id; var response; $.ajax({ async : false, type: 'DELETE', url: url, ... My removeId is a variable that includes UTF-8 character. I will handle that variable at Java s

  • How to call Office 2011 Powerpoint VBA function using Apple Script 2014-06-30

    Hi, We are using Office 2011 power point VBA script for displaying the presentation from our Application. Now there is scenario where we need to call the VBA funtion by using Apple script. How can we achieve the functionality...an any one please help

  • Node JS AWS S3 file upload. How to get public URL response 2018-11-13

    I'm uploading a file to Amazon S3 using the Node SDK. The file uploads are working fine, but I want to get the public url of the file to send back to the client. At the moment the response I get is: Successfully uploaded data { ETag: '"957cd1a335adf5

  • Amazon S3 Url rewrite 2009-02-20

    How can I change the Amazon S3 url from to EDIT: Basically the whole reason for this is to hide the amazon s3 url from my users. I was thinking about a HttpModule that would redirect the request from image.mydomain.com to bucket.amazons3.com. But tha

  • How to "URL decode" a string in Emacs Lisp? 2009-03-04

    I've got a string like "foo%20bar" and I want "foo bar" out of it. I know there's got to be a built-in function to decode a URL-encoded string (query string) in Emacs Lisp, but for the life of me I can't find it today, either in my lisp/ folder or wi

  • Pass a key stroke (i.e., Enter Key) into application using WatiN scripts 2009-05-13

    I'm using WatiN testing tool. Can I pass a key stroke (i.e., pressing a enter key) to the application using WatiN scripts? This option was available in WatiR. Is this option available in WatiN? --------------Solutions------------- EDIT: Upon further

  • Is it impossible for routing existing url by using Asp.net Routing? 2009-06-17

    From my last question, I have been found that Asp.net Routing can't route with existing url for more info read this. How to redirect existing url to another url by using Asp.net Routing? Hint! I think, this behevior like access denied behevior that a

  • amazon short url regex- why can't i get this to work 2009-10-20

    here is a regex i got from: a blog i can't link to because i am new... just google amazon short url and click on the blog post by noah coad as you can see from this page... it is supposed to extract the unique product id from any amazon url so you ca

  • Question about url rewriting using apache mod_rewrite 2009-12-01

    I have a doubt about url rewriting using apache mod_rewrite. I am a newbie in mod_rewrite and I don't have any experience in regex. What I want to do is to: Rewrite / To /web/content/public/ Rewrite /clients/ To /web/content/clients/ How can I achiev

  • Create a RESTful url for a php script 2009-12-24

    I have a php script on a webserver. Currently, the script is being accessed as http://www.mydomain.com/scriptname.php . Is there a way i can create a user friendly url for accessing this script, something like http://www.mydomain.com/appname, so when

  • Alias an URL in Apache in order to route requests on a certain URL through a PHP-script 2010-01-27

    I am using Apache 2.2.6 with suPHP 0.6.2 and PHP 5.2.6 and I am trying to use an Alias in order to route all requests on a certain URL trough a PHP script. I want all requests to /test to go through index.php. In the Apache virtualhost config I have

  • How to customize a URL to use a name different than my Controller? 2010-03-04

    I'm using ASP.NET MVC to develop a website and I need to customize my URL to use a name that is not the name of my Controller. I want to use this Class/Method names: public class CompanyController:Controller { public ActionResult About() { return Vie

  • ASP.NET MVC URL decode 2010-04-09

    I have an action like this: <%=Html.ActionLink("My_link", "About", "Home", new RouteValueDictionary { { "id", "Österreich" } }, null)%> This produces the following link: http://localhost:1855/Home/About/%C3%96sterreich I want a link which looks

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.078 (s). 11 q(s)