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 --concurrent
Note
Squid can use only one URL redirector program at a time, so we should specify only one program using the url_rewrite_program directive.
Controlling redirector children
Once we have specified the redirector program, we...