mercredi 30 septembre 2015

Nginx redirection magic

I have a third-party that's forwarding traffic over to me on a subdomain - let's call it subdomain.thirdparty.com

I would like to forward this traffic over to http://ift.tt/1Ghl5J5 - this is where the app lives. The links in the app require the /subdomain part in the URL.

BUT I would like to maintain the third-party URL in the browser, something like subdomain.thirdparty.com or http://ift.tt/1L4auXG

I'm hosted on AWS so I have Route 53 available to me, and have the following Nginx setup:

server{
    server_name *.mysite.com;
    listen 80;

    location /subdomain/{
        proxy_set_header SCRIPT_NAME /subdomain;
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:9014;
    }
}

I've tinkered around with Nginx settings but just can't seem to figure it out. Any guidance would be greatly appreciated.




Aucun commentaire:

Enregistrer un commentaire