Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I found a solution by replacing the URLs by doing the following in my config:

sub_filter 'static.thepiratebay.se' 'static.proxy.example.com';
sub_filter_once off;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.