IncludeFile

IncludeFile is a position-independent config.txt/ezproxy.cfg 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/ezproxy.cfg file. The additional files processed due to IncludeFile can contain any config.txt/ezproxy.cfg directives with the exception that they may not use IncludeFile, disallowing the inclusion of one file from another included file.

Generated Configuration Example

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/ezproxy.cfg might look like:

Name ezproxy.yourlib.org
LoginPort 80

Title Some Database with special configuration need
URL http://www.somedb.com
Domain somedb.com
Find NAME="_PRIORREFERER" VALUE="http://
Replace NAME="_PRIORREFERER" VALUE="http://^A
IncludeFile generated.cfg

and the sample generated.cfg might look like:

Title http://www.otherdb.com
URL http://www.otherdb.com
Domain otherdb.com

Title http://www.anotherdb.com
URL http://www.anotherdb.com
Domain another.db.com

Separating the hand-edited config.txt/ezproxy.cfg 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/ezproxy.cfg or one of its included files defines the behavior for that database, overriding any similar entries that appear later in the configuration.

High Availability Configuration Example

If you use the HAName and HAPeer directives to create High Availability configuration of EZproxy, the bulk of config.txt/ezproxy.cfg 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/ezproxy.cfg like this:

IncludeFile specific.cfg
HAName shared.yourlib.org
HAPeer http://ezp1.yourlib.org:2048/
HAPeer http://ezp2.yourlib.org:2048/

and have the specific.cfg contain system-specific lines such as:

Name ezp1.yourlib.org
Interface 68.14.229.197

With this setup, you can copy config.txt/ezproxy.cfg to all servers as you make changes without any need to modify the file for each server to changes its Name directive.