反向代理DuckDuckGo
注意替换example.com
与证书路径!
配置如下:
server {
listen [::]:443;
listen 443;
server_name duckgo.example.com;
ssl on;
ssl_certificate /root/ssl_cert/duck.crt;
ssl_certificate_key /root/ssl_cert/duck.key;
sub_filter_types text/html text/css application/x-javascript text/xml;
access_log off;
location / {
proxy_pass https://duckduckgo.com;
proxy_set_header Host duckduckgo.com;
proxy_set_header Accept-Encoding "";
proxy_set_header Referer "";
sub_filter "duckduckgo.com" "duckgo.example.com";
sub_filter_once off;
}
}
server {
listen [::]:443;
listen 443;
server_name images.duckgo.example.com;
ssl on;
ssl_certificate /root/ssl_cert/duck.crt;
ssl_certificate_key /root/ssl_cert/duck.key;
access_log off;
location / {
proxy_pass https://images.duckduckgo.com;
proxy_set_header Host images.duckduckgo.com;
}
}
server {
listen [::]:443;
listen 443;
server_name icons.duckgo.example.com;
ssl on;
ssl_certificate /root/ssl_cert/duck.crt;
ssl_certificate_key /root/ssl_cert/duck.key;
access_log off;
location / {
proxy_pass https://icons.duckduckgo.com;
proxy_set_header Host icons.duckduckgo.com;
}
}
server {
listen [::]:443;
listen 443;
server_name ac.duckgo.example.com;
ssl on;
ssl_certificate /root/ssl_cert/duck.crt;
ssl_certificate_key /root/ssl_cert/duck.key;
access_log off;
location / {
proxy_pass https://ac.duckduckgo.com;
proxy_set_header Host ac.duckduckgo.com;
}
}
server {
listen [::]:443;
listen 443;
server_name external-content.duckgo.example.com;
ssl on;
ssl_certificate /root/ssl_cert/duck.crt;
ssl_certificate_key /root/ssl_cert/duck.key;
access_log off;
location / {
proxy_pass https://external-content.duckduckgo.com;
proxy_set_header Host external-content.duckduckgo.com;
}
}
server {
listen [::]:443;
listen 443;
server_name improving.duckgo.example.com;
ssl on;
ssl_certificate /root/ssl_cert/duck.crt;
ssl_certificate_key /root/ssl_cert/duck.key;
access_log off;
location / {
proxy_pass https://improving.duckduckgo.com;
proxy_set_header Host improving.duckduckgo.com;
}
}