IncludeFile is a position-independent config.txt directive that tells EZproxy to open the specified file and use it to configure EZproxy as though its contents were part of the main config.txt file. The additional files called and processed with the IncludeFile directive can contain any config.txt directives including additional IncludeFile lines. There are limits on the number of times a file referenced in an IncludeFile line can be called, a file can only be included once (EZproxy will process the file the first time it encounters it), and EZproxy has safeguarded against IncludeFile loop errors (e.g., IncludeFile 1 references IncludeFile 2 which references IncludeFile 1).
For those sites that use programs to generate their database definitions, IncludeFile provides a convenient way to intermix the general EZproxy configuration directives, database-specific directives, and generated directives. A sample config.txt might look like:
Title Some Database with special configuration need
Find NAME="_PRIORREFERER" VALUE="http://
Replace NAME="_PRIORREFERER" VALUE="http://^A
and the sample generated.cfg might look like:
Separating the hand-edited config.txt from the computer-produced generated.cfg reduces the chance of losing special configuration options and also simplifies overriding generated configuration with manually specified configuration, since the first database definition in config.txt or one of its included files defines the behavior for that database, overriding any similar entries that appear later in the configuration.
If you use the HAName and HAPeer directives to create High Availability configuration of EZproxy, the bulk of config.txt is identical on all servers. The only difference should be the Name directive and any Interface directives. To simplify maintenance, you can setup config.txt like this:
and have the specific.cfg contain system-specific lines such as:
With this setup, you can copy config.txt to all servers as you make changes without any need to modify the file for each server to changes its Name directive.