Skip to content

Instantly share code, notes, and snippets.

@micahw156
Created October 25, 2013 14:19
Show Gist options
  • Save micahw156/7155393 to your computer and use it in GitHub Desktop.
Save micahw156/7155393 to your computer and use it in GitHub Desktop.
Drupal 7 settings.php hacks for operating behind NetIQ Access Manager
<?php
/**
* Base URL (optional).
*
* If Drupal is generating incorrect URLs on your site, which could
* be in HTML headers (links to CSS and JS files) or visible links on pages
* (such as in menus), fill in the absolute URL to your Drupal installation.
*
* We have to set $base_url if we're behind a Novell Access Manager proxy.
*/
if (isset($_SERVER['HTTP_VIA']) && strpos($_SERVER['HTTP_VIA'], 'Access Gateway')){
$http_via = explode(' ', $_SERVER['HTTP_VIA'], 3);
$base_url = 'https://' . $http_via[1];
}
/**
* Enable this setting to determine the correct IP address of the remote
* client by examining information stored in the X-Forwarded-For headers.
*/
$conf['reverse_proxy'] = TRUE;
/**
* reverse_proxy accepts an array of IP addresses.
*/
# $conf['reverse_proxy_addresses'] = array('a.b.c.d', ...);
@sharpchi
Copy link

Thanks for this. Exactly what I needed. I was trying to find a way of avoiding hard-coding the base url behind access manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment