Skip to content

Scripts to populate a list of reverse proxy addresses for Drupal sites

Notifications You must be signed in to change notification settings

yusufhm/drupal-elb-ips-from-varnish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

drupal-elb-ips-from-varnish

These scripts enable you to populate the $conf['reverse_proxy_addresses'] in settings.php for a Drupal site.

  1. Set up cron job

Set up a cron job to regularly update the elb-ips.list file via varnishncsa.

An example job would be:

*/15 * * * * varnishncsa -d | grep 'ELB-HealthChecker' | awk '{ print $1 }' | /path/to/repo/unique-ips.py > /path/to/repo/elb-ips.list
  1. Add code to settings.php

Add the following code at the end of your settings.php to read the elb-ips.list file and set the correct reverse proxy IPs:

$ip_list_file = "/path/to/repo/reverse-ips-from-elbips.php";
if (file_exists($ip_list_file)) {
  require($ip_list_file);
}

About

Scripts to populate a list of reverse proxy addresses for Drupal sites

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published