Setting up proxy to handle subdomain requests
Posted
by
PeeHaa
on Server Fault
See other posts from Server Fault
or by PeeHaa
Published on 2012-12-01T19:07:20Z
Indexed on
2012/12/01
23:06 UTC
Read the original article
Hit count: 186
I have setup a proxy for a site which works with the following nginx
config:
server {
listen 80;
server_name proxy.example.com;
access_log /dev/null;
error_log /dev/null;
location / {
proxy_pass http://thepiratebay.se;
proxy_set_header X-Real-IP $remote_addr;
}
}
However on this there are also styles loaded from a subdomain (static.thepiratebay.se
) which aren't going through my proxy, because it links to the original domain. Is there a way to also let those requests go to my proxy? Do I have to change the contents of the pages when serving it to let them also go through my proxy? If so: how? :) Or is there another (perhaps better) way?
© Server Fault or respective owner