Locationget {set $ hostx; set $ addrs; if ($ uri ~ ^ Gethttp. + ([^] + )(. +) $) {set $ hostx $1; set $ addrs $2;} resolver127.0.0.1; proxy_passhttp: $ hostx $ addrs; proxy_set_headerrefererhttp: $ hostx;} This configuration can proxy the Internet
LoCatIon/get/
{
Set$ Hostx;
Set $DdRs;
If ($ uri ~ ^/Get/http./+ ([^/] +)/(. +) $ ){
Set $ hostx $1;
Set $ addrs $2;
}
Resolver 127.0.0.1;
Proxy_pass http: // $ hostx/$ addrs;
Proxy_set_header referer http: // $ hostx;
}
This configuration can proxy all http pages/images on the Internet, and can cross the general anti-leech restrictions.
Access Method: http: // www.SuDone.com/get/http://www.google.com/tooLs/Dlpage/res/chrome/images/chrome-205_noshadow.png
Because nginx does not automatically read the system's dns to resolve the domain name, you need to define a resolver as the dns server.
Note: In order to reduce the "trouble", I did not deploy this function on official occasions.
Author Ayou: http://sudone.com