Drupal devPortal issue behind an enterprise http proxy

Hello,

We are encountering an issue in using Drupal devPortal onPremise behind an enterprise httpProxy.
The devconnect is unable to reach the management server API. It fails with connect timeout after 4 seconds (the default value).

We tried a lot of things to configure PHP without any success.
All the following tries don't work. Some of them are very dirty and thus not acceptable.


Try 1 :
Adding vars in /etc/environment

http_proxy=http://myProxyHostname:3128
https_proxy=http://myProxyHostname:3128
HTTP_PROXY=http://myProxyHostname:3128
HTTPS_PROXY=http://myProxyHostname:3128


Try 2 :
Adding vars in .profile for the user apigee :

export http_proxy='http://myProxyHostname:3128'
export https_proxy='http://myProxyHostname:3128'


Try 3 :
- Customize Drupal by adding $conf['proxy_server'] and $conf['proxy_port'] in .../apigee-drupal-devportal/conf/settings.php
(Done by patching the source because there is no customer token for this.)


Try 4 :
Adding in /opt/apigee/data/apigee-drupal-devportal/sites/default/default.settings.php :

$conf['proxy_server'] = 'xx.xx.xx.xx';
$conf['proxy_port'] = 3128;


Try 5 :
Setting http_proxy in ~/.curlrc


Try 6 :
Using an auto_prepend_file in php.ini like this :

  <?php
  stream_context_set_default(['http'=>['proxy'=>'xx.xx.xx.xx:3128']]);
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_PROXY, "http://xx.xx.xx.xx:3128");


(See here for the idea : https://stackoverflow.com/a/40771206 )


Try 7 (very dirty) :
Adding $curl_options['http_proxy'] = 'http://myProxyHostname:3128';
in file modules/custom/devconnect/devconnect.admin.inc line 710




Nothing in Apigee documentation about http proxy.
Any help would be appreciated.


Regards,
Nicolas.

Solved Solved
0 5 975
1 ACCEPTED SOLUTION

Here is a working solution. Perhaps not the best.

Before this 4.18.01, we were using an old release based on Apache httpd. It worked by adding the proxy configuration directly in the systemd conf for httpd.

Now, it's NGinx and PHP-FPM. It doesn't work the same way.

I managed to reach the management server through http proxy by adding these lines in /opt/apigee/apigee-drupal-devportal/source/conf/php-fpm.conf

  env["http_proxy"]= "http://myProxyHost:myProxyPort"
  env["https_proxy"] = "http://myProxyHost:myProxyPort"

It's a bit dirty because it's in the "source" folder of apigee-devportal.

On the other hand, there is no token allowing to add custom entries in this file.

Moreover, the php-fpm process doesn't use at all the default config in /etc/php-fpm.conf or /etc/php-fpm.d/www.conf

So patching the source seems the only working solution. Does anybody from Apigee has a better idea ?

Regards.

View solution in original post

5 REPLIES 5

jyothikiranr
Participant IV

@Nicolas TISSERAND

Could you try this in dev connect settings

http://EdgePrivateCloudIp:8080/v1

or

https://EdgePrivateCloudIp:TLSport/v1

In most cases your TLSport would be 8443 unless you are using a different one for your install

Let me know how it goes!

p.s please try without any proxy options you've set for connectivity.

Hi @Jyothi K Reddy , thanks for your idea.

Unfortunately, it doesn't work neither by using the IP (we are in http, not https) :

7083-capture-du-2018-07-05-17-52-47.png

We must go through the proxy even for IP addreses.

@Nicolas TISSERAND I have a couple of things we could try.

Pls check if your IP is the same as the one in /tmp/edge/edge-devportal-dp-response-{version_numnber}.

This file has an entry for MGMT_URL="http://$IP1:8080/v1"

If this is the IP you are using, and geting connectivity issue, I will try to simulate your settings and see if settings.php entries can be tuned ?

@Jyothi K Reddy

I've found a solution, thanks for trying to help (I'll put the details in a new answer so that people can vote for it).

There is no such file edge-devportal-dp-response-* anywhere on the server. (We use apigee-drupal-devportal 4.18.01-0.0.262).

But, the MGMT_URL entry is present in the silent config file used to install the devPortal.

This entry points to the management server with the DNS name which is what we prefer. The configuration is coherent. Using the IP was just a test for you.

To complete the test, we can `curl` to the management server in commandline through the http_proxy. Indifferently with the IP address or the DNS name.

Regards.

Here is a working solution. Perhaps not the best.

Before this 4.18.01, we were using an old release based on Apache httpd. It worked by adding the proxy configuration directly in the systemd conf for httpd.

Now, it's NGinx and PHP-FPM. It doesn't work the same way.

I managed to reach the management server through http proxy by adding these lines in /opt/apigee/apigee-drupal-devportal/source/conf/php-fpm.conf

  env["http_proxy"]= "http://myProxyHost:myProxyPort"
  env["https_proxy"] = "http://myProxyHost:myProxyPort"

It's a bit dirty because it's in the "source" folder of apigee-devportal.

On the other hand, there is no token allowing to add custom entries in this file.

Moreover, the php-fpm process doesn't use at all the default config in /etc/php-fpm.conf or /etc/php-fpm.d/www.conf

So patching the source seems the only working solution. Does anybody from Apigee has a better idea ?

Regards.