Created
November 28, 2011 19:46
-
-
Save dmdeller/1401727 to your computer and use it in GitHub Desktop.
DuckDuckGo nginx config for handling Safari search bar requests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name search.yahoo.com; | |
# only handle requests from Safari search bar | |
if ($args ~ fr=aaplw.*p=) { | |
rewrite ^/search https://duckduckgo.com/?q=$arg_p? break; | |
} | |
# attempt to redirect other requests back to Yahoo, using alternative server name | |
rewrite ^ http://search.ystg1.b.yahoo.com$request_uri? break; | |
} | |
server { | |
server_name www.google.com; | |
# only handle requests from Safari search bar | |
if ($args ~ client=safari.*q=) { | |
rewrite ^/search https://duckduckgo.com/?q=$arg_q? break; | |
} | |
# redirect other requests to info page explaining what happened | |
rewrite ^ http://help.duckduckgo.com/customer/portal/articles/255678? break; | |
} | |
server { | |
server_name www.bing.com; | |
# only handle requests from Safari search bar | |
if ($args ~ q=.*form=APMCS1) { | |
rewrite ^/search https://duckduckgo.com/?q=$arg_q? break; | |
} | |
# redirect other requests to info page explaining what happened | |
rewrite ^ http://help.duckduckgo.com/customer/portal/articles/255682? break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment