Last active
May 12, 2017 18:29
-
-
Save ftischhauser/4e9ab11a8cc80f40ed2e to your computer and use it in GitHub Desktop.
Nginx as a blackhole server for PAC based ad blockers
This file contains hidden or 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 { | |
# Listen on port 9123. Change to your liking and remove 'deferred' if unsupported on your OS. | |
listen [::]:9123 ipv6only=off deferred; | |
# We don't need to log these proxy requests. | |
access_log off; | |
# Let browsers cache our responses. | |
expires max; | |
location / { | |
# Return an empty gif for all requests. | |
empty_gif; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Safari on iOS 8 now shows the "Open in..." dialog for empty responses, so it's safer to just output empty_gif for all requests.