Error Using Nextcloud 11 behind proxy

Nextcloud version : 11.0.0.10
Operating system and version: RHEL 7.3
Apache: 2.4.6 (default from RHEL 7.3)
PHP version: 7.0.10 / from RHEL SCL (rh-php70)

As the server can only connect to internet via proxy I added to config.php:
‘proxy’ => ‘http://myproxy:1234’,

Logged into Nextcloud I get “There were problems with the code integrity check. More information…” - link behind that refers to :index.php/settings/admin#security-warning

There I get under “Security & setup warnings”: Error occurred while checking server setup

nextcloud.log reports:
{“reqId”:“WHScdl5CqVICrBUT9DZ6uQAAAAg”,“remoteAddr”:“10.0.0.96”,“app”:“index”,“message”:“Exception: {“Exception”:“GuzzleHttp\\Exception\\RequestException”,“Message”:“cURL error 56: Received HTTP code 403 from proxy after CONNECT”,“Code”:0,“Trace”:”#0 \/var\/www\/html\/nextcloud\/3rdparty\/guzzlehttp\/guzzle\/src\/RequestFsm.php(103): GuzzleHttp\\Exception\\RequestException::wrapException(Object(GuzzleHttp\\Message\\Request), Object(GuzzleHttp\\Ring\\Exception\\RingException))\n#1 \/var\/www\/html\/nextcloud\/3rdparty\/guzzlehttp\/guzzle\/src\/RequestFsm.php(132): GuzzleHttp\\RequestFsm->__invoke(Object(GuzzleHttp\\Transaction))\n#2 \/var\/www\/html\/nextcloud\/3rdparty\/react\/promise\/src\/FulfilledPromise.php(25): GuzzleHttp\\RequestFsm->GuzzleHttp\\{closure}(Array)\n#3 \/var\/www\/html\/nextcloud\/3rdparty\/guzzlehttp\/ringphp\/src\/Future\/CompletedFutureValue.php(55): React\\Promise\\FulfilledPromise->then(Object(Closure), NULL, NULL)\n#4 \/var\/www\/html\/nextcloud\/3rdparty\/guzzlehttp\/guzzle\/src\/Message\/FutureResponse.php(43): GuzzleHttp\\Ring\\Future\\CompletedFutureValue->then(Object(Closure), NULL, NULL)\n#5 \/var\/www\/html\/nextcloud\/3rdparty\/guzzlehttp\/guzzle\/src\/RequestFsm.php(134): GuzzleHttp\\Message\\FutureResponse::proxy(Object(GuzzleHttp\\Ring\\Future\\CompletedFutureArray), Object(Closure))\n#6 \/var\/www\/html\/nextcloud\/3rdparty\/guzzlehttp\/guzzle\/src\/Client.php(165): GuzzleHttp\\RequestFsm->__invoke(Object(GuzzleHttp\\Transaction))\n#7 \/var\/www\/html\/nextcloud\/3rdparty\/guzzlehttp\/guzzle\/src\/Client.php(125): GuzzleHttp\\Client->send(Object(GuzzleHttp\\Message\\Request))\n#8 \/var\/www\/html\/nextcloud\/lib\/private\/Http\/Client\/Client.php(137): GuzzleHttp\\Client->get(‘https:\/\/www.own…’, Array)\n#9 \/var\/www\/html\/nextcloud\/settings\/Controller\/CheckSetupController.php(216): OC\\Http\\Client\\Client->get(‘https:\/\/www.own…’)\n#10 \/var\/www\/html\/nextcloud\/settings\/Controller\/CheckSetupController.php(368): OC\\Settings\\Controller\\CheckSetupController->isUsedTlsLibOutdated()\n#11 [internal function]: OC\\Settings\\Controller\\CheckSetupController->check()\n#12 \/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(160): call_user_func_array(Array, Array)\n#13 \/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php(90): OC\\AppFramework\\Http\\Dispatcher->executeController(Object(OC\\Settings\\Controller\\CheckSetupController), ‘check’)\n#14 \/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/App.php(114): OC\\AppFramework\\Http\\Dispatcher->dispatch(Object(OC\\Settings\\Controller\\CheckSetupController), ‘check’)\n#15 \/var\/www\/html\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php(47): OC\\AppFramework\\App::main(‘OC\\\\Settings\\\\Con…’, ‘check’, Object(OC\\AppFramework\\DependencyInjection\\DIContainer), Array)\n#16 [internal function]: OC\\AppFramework\\Routing\\RouteActionHandler->__invoke(Array)\n#17 \/var\/www\/html\/nextcloud\/lib\/private\/Route\/Router.php(299): call_user_func(Object(OC\\AppFramework\\Routing\\RouteActionHandler), Array)\n#18 \/var\/www\/html\/nextcloud\/lib\/base.php(1010): OC\\Route\\Router->match(’\/settings\/ajax\/…’)\n#19 \/var\/www\/html\/nextcloud\/index.php(40): OC::handleRequest()\n#20 {main}",“File”:"\/var\/www\/html\/nextcloud\/3rdparty\/guzzlehttp\/guzzle\/src\/Exception\/RequestException.php",“Line”:51}",“level”:3,“time”:“2017-01-10T08:34:00+00:00”,“method”:“GET”,“url”:"/index.php/settings/ajax/checksetup",“user”:“nextadmin”,“version”:“11.0.0.10”}

No specific entries in Apache-Logs.

Any ideas?

Best regards, xrzxrz

Hello,

i have the same problem on a machine running Centos 7.3. When i browse my Site i get the same failure
could you please help me with this issue.

Best regard, resa

Version 11.0.1 does not solve the problem.
If I transfer the machine to a lan segent with direct internet access, the messages disappear. So it seems, that CheckSetupController, does ignore the proxy settings in config.php.

have you tried with myproxy:1234 (without http://) ??

Hi,
I have tried both ways, both result in the same error.
Best regards, xrzxrz

Hello.
Is it possible to add an exception for variable ‘proxy’ in config.php?

Hello there,

i got the same error,if i add my proxy with http-Port to config.php

However if i add my proxy with https-port, the error in the logs is replaced by

GuzzleHttp\Exception\ClientException: Client error response [url] http://www.github.com/ [status code] 403 [reason phrase] Forbidden

Also in the section “Security & setup warnings” the above mentioned error is replaced by “No internet Connection”

Is there a way to specify more values for ‘proxy’ in config.php ?
I have already tried adding an Array but this ends in parsing errors.

Best regards,
MrHundert

Has anyone found a solution for that?

It looks like nextcloud does not take into account the certificate from the OS (Debian in my case).

EDIT: So I tried to add the certificate to nextcloud using the occ security:certificates command: https://docs.nextcloud.com/server/12/admin_manual/configuration_server/occ_command.html#security but this did nothing, which seems to be as expected. Still investigating why GuzzleHttp does not use a proxy.