Configuring Squid
Once we have finished writing the redirector program, we need to configure Squid to use it properly. There are a few directives in the Squid configuration file using which we can control how Squid will use our URL redirector program. Let's have a quick look at these directives.
Specifying the URL redirector program
We can specify the absolute path to our URL redirector program using the url_rewrite_program
directive. We can also specify any additional interpreter or command line arguments that the program expects. The following are a few examples:
url_rewrite_program /opt/squid/libexec/custom_rewriter url_rewrite_program /usr/bin/python /opt/squid/libexec/my_rewriter.py url_rewrite_program /usr/bin/python /opt/squid/libexec/another_rewriter.py ...
Get Squid Proxy Server 3.1 Beginner's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.