# Using proxy server within nextcloud

**URL:** <https://help.nextcloud.com/t/using-proxy-server-within-nextcloud/3718>\
**Category:** ℹ️ Support\
**Created:** [September 29, 2016, 1:28pm UTC](https://help.nextcloud.com/t/using-proxy-server-within-nextcloud/3718 "2016-09-29T13:28:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![martva](https://help.nextcloud.com/letter_avatar/martva/32/6_22734026db12803ebb3e059622ac3534.png) [@martva](https://help.nextcloud.com/u/martva)\
**Post date:** [September 29, 2016, 1:28pm UTC](https://help.nextcloud.com/t/using-proxy-server-within-nextcloud/3718/1 "2016-09-29T13:28:43Z")

</div>

I’m a newbie when it comes to nextcloud.  
I’m running a nextcloud 10.0.1 installation on a LAMP server.  
A firewall is setup to allow incoming connections over 443. And a https\_proxy server is used when I need to update the server using yum and connecting to the internet.

Right now when I go to Apps within the webgui it takes a while to see all the apps. A message appears on the top of the screen saying the page could not be loaded. Refreshing in 5 seconds.

Looking in the logs I see:  
`Could not get categories: cURL error 28: connect() timed out!","level":3,"time":"2016-09-28T13:05:03+00:00`

and

`Could not get application: cURL error 28: connect() timed out!`

I think the installation is unable to connect to the internet due to way we setup the host.  
Is there a way to add a proxy server so that the nextcloud installation can for new versions of apps and for the installation?

Thanks!

---

<div class="post-metadata">

**Author:** ![Smaig](https://help.nextcloud.com/user_avatar/help.nextcloud.com/smaig/32/127_2.png) [@Smaig](https://help.nextcloud.com/u/Smaig)\
**Post date:** [September 29, 2016, 2:12pm UTC](https://help.nextcloud.com/t/using-proxy-server-within-nextcloud/3718/2 "2016-09-29T14:12:49Z")

</div>

This might helps you:

You can make a alias in your ~/.bashrc file :

`alias curl="curl -x <proxy_host>:<proxy_port>"`  
Another solution is to use (maybe the better solution) the ~/.curlrc file (create it if it does not exist) :

`proxy = <proxy_host>:<proxy_port>`

> <https://stackoverflow.com/questions/7559103/how-to-setup-curl-to-permanently-use-a-proxy>

---

<div class="post-metadata">

**Author:** ![anon58843897](https://help.nextcloud.com/letter_avatar/anon58843897/32/6_22734026db12803ebb3e059622ac3534.png) [@anon58843897](https://help.nextcloud.com/u/anon58843897)\
**Post date:** [September 29, 2016, 2:20pm UTC](https://help.nextcloud.com/t/using-proxy-server-within-nextcloud/3718/3 "2016-09-29T14:20:26Z")

</div>

Try setting the proxy url and authentication in the config/config.php file. For example,

‘proxy’ =\> ‘myproxy.server.ext’,  
‘proxyuserpwd’ =\> ‘username:password’

Take a look at config/config.sample.php for more information.

---

<div class="post-metadata">

**Author:** ![martva](https://help.nextcloud.com/letter_avatar/martva/32/6_22734026db12803ebb3e059622ac3534.png) [@martva](https://help.nextcloud.com/u/martva)\
**Post date:** [September 29, 2016, 2:55pm UTC](https://help.nextcloud.com/t/using-proxy-server-within-nextcloud/3718/4 "2016-09-29T14:55:06Z")

</div>

> [@grouchysysadmin](#):
>
> Try setting the proxy url and authentication in the config/config.php file. For example,
> 
> ‘proxy’ =\> ‘myproxy.server.ext’,  
> ‘proxyuserpwd’ =\> ‘username:password’
> 
> Take a look at config/config.sample.php for more information.

Looks like this option helped getting all the internet related connection errors out of the log. The Admin pages and Apps pages load a lot quicker now.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![martva](https://help.nextcloud.com/letter_avatar/martva/32/6_22734026db12803ebb3e059622ac3534.png) [@martva](https://help.nextcloud.com/u/martva)\
**Post date:** [October 25, 2016, 1:09pm UTC](https://help.nextcloud.com/t/using-proxy-server-within-nextcloud/3718/5 "2016-10-25T13:09:05Z")

</div>

Although it looks like to proxy is working, I’m still getting errors. Especially when nextcloud is checking for updates:

I’ve anonimized the ipaddresses. 1.1.1.1 is my outside IP and 2.2.2.2 in my internal squid host.  
Curl is stating it gets a permission denied, I cannot find any clue of this in the logging of the squid host.

“cURL error 7: Failed to connect to 2.2.2.2: Permission denied”

Also it looks like the installation is still looking at owncloud.

\/var\/www\/file\/settings\/Controller\/CheckSetupController.php(195): OC\\Http\\Client\\Client-\>get(‘ **https:\/\/www.own…** ’)\n#10

But looking at the config.php I see it needs to look at [https://updates.nextcloud.org/updater\_server/](https://updates.nextcloud.org/updater_server/), but this is turned off.

‘updatechecker’ =\> false,  
‘updater.server.url’ =\> ‘[https://updates.nextcloud.org/updater\_server/](https://updates.nextcloud.org/updater_server/)’,  
‘updater.release.channel’ =\> ‘stable’,

And when I telnet to the squid proxy and running these commands, all is okay.

```
root@centoshost config]# telnet 2.2.2.2 3128
Trying 2.2.2.2...
Connected to 2.2.2.2.
Escape character is '^]'.
GET http://www.google.com/ HTTP/1.1
host:www.google.com

HTTP/1.1 302 Moved Temporarily
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Location: http://www.google.be/?gfe_rd=cr&ei=IVQPWPi1JbLH8Aft0qPoBw
Content-Length: 258
Date: Tue, 25 Oct 2016 12:46:25 GMT
X-Cache: MISS from ubuntuhost
X-Cache-Lookup: MISS from ubuntuhost:3128
Via: 1.1 ubuntuhost (squid/3.3.8)
Connection: keep-alive

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.be/?gfe_rd=cr&amp;ei=IVQPWPi1JbLH8Aft0qPoBw">here</A>.
</BODY></HTML>

```

Anyone any ideas on how this can be corrected?

`{"reqId":"c8dA+WKZMIVFqdb4nCJW","remoteAddr":"1.1.1.1","app":"index","message":"Exception: {\"Exception\":\"GuzzleHttp\\\\Exception\\\\ConnectException\",\"Message\":\"cURL error 7: Failed to connect to 2.2.2.2: Permission denied\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/file\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/RequestFsm.php(104): GuzzleHttp\\\\Exception\\\\RequestException::wrapException(Object(GuzzleHttp\\\\Message\\\\Request), Object(GuzzleHttp\\\\Ring\\\\Exception\\\\ConnectException))\\n#1 \\\/var\\\/www\\\/file\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/RequestFsm.php(132): GuzzleHttp\\\\RequestFsm->__invoke(Object(GuzzleHttp\\\\Transaction))\\n#2 \\\/var\\\/www\\\/file\\\/3rdparty\\\/react\\\/promise\\\/src\\\/FulfilledPromise.php(25): GuzzleHttp\\\\RequestFsm->GuzzleHttp\\\\{closure}(Array)\\n#3 \\\/var\\\/www\\\/file\\\/3rdparty\\\/guzzlehttp\\\/ringphp\\\/src\\\/Future\\\/CompletedFutureValue.php(55): React\\\\Promise\\\\FulfilledPromise->then(Object(Closure), NULL, NULL)\\n#4 \\\/var\\\/www\\\/file\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/Message\\\/FutureResponse.php(43): GuzzleHttp\\\\Ring\\\\Future\\\\CompletedFutureValue->then(Object(Closure), NULL, NULL)\\n#5 \\\/var\\\/www\\\/file\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/RequestFsm.php(135): GuzzleHttp\\\\Message\\\\FutureResponse::proxy(Object(GuzzleHttp\\\\Ring\\\\Future\\\\CompletedFutureArray), Object(Closure))\\n#6 \\\/var\\\/www\\\/file\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/Client.php(165): GuzzleHttp\\\\RequestFsm->__invoke(Object(GuzzleHttp\\\\Transaction))\\n#7 \\\/var\\\/www\\\/file\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/Client.php(125): GuzzleHttp\\\\Client->send(Object(GuzzleHttp\\\\Message\\\\Request))\\n#8 \\\/var\\\/www\\\/file\\\/lib\\\/private\\\/Http\\\/Client\\\/Client.php(137): GuzzleHttp\\\\Client->get('https:\\\/\\\/www.own...', Array)\\n#9 \\\/var\\\/www\\\/file\\\/settings\\\/Controller\\\/CheckSetupController.php(195): OC\\\\Http\\\\Client\\\\Client->get('https:\\\/\\\/www.own...')\\n#10 \\\/var\\\/www\\\/file\\\/settings\\\/Controller\\\/CheckSetupController.php(346): OC\\\\Settings\\\\Controller\\\\CheckSetupController->isUsedTlsLibOutdated()\\n#11 [internal function]: OC\\\\Settings\\\\Controller\\\\CheckSetupController->check()\\n#12 \\\/var\\\/www\\\/file\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(160): call_user_func_array(Array, Array)\\n#13 \\\/var\\\/www\\\/file\\\/lib\\\/private\\\/AppFramework\\\/Http\\\/Dispatcher.php(90): OC\\\\AppFramework\\\\Http\\\\Dispatcher->executeController(Object(OC\\\\Settings\\\\Controller\\\\CheckSetupController), 'check')\\n#14 \\\/var\\\/www\\\/file\\\/lib\\\/private\\\/AppFramework\\\/App.php(111): OC\\\\AppFramework\\\\Http\\\\Dispatcher->dispatch(Object(OC\\\\Settings\\\\Controller\\\\CheckSetupController), 'check')\\n#15 \\\/var\\\/www\\\/file\\\/lib\\\/private\\\/AppFramework\\\/Routing\\\/RouteActionHandler.php(47): OC\\\\AppFramework\\\\App::main('CheckSetupContr...', 'check', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#16 [internal function]: OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler->__invoke(Array)\\n#17 \\\/var\\\/www\\\/file\\\/lib\\\/private\\\/Route\\\/Router.php(293): call_user_func(Object(OC\\\\AppFramework\\\\Routing\\\\RouteActionHandler), Array)\\n#18 \\\/var\\\/www\\\/file\\\/lib\\\/base.php(983): OC\\\\Route\\\\Router->match('\\\/settings\\\/ajax\\\/...')\\n#19 \\\/var\\\/www\\\/file\\\/index.php(48): OC::handleRequest()\\n#20 {main}\",\"File\":\"\\\/var\\\/www\\\/file\\\/3rdparty\\\/guzzlehttp\\\/guzzle\\\/src\\\/Exception\\\/RequestException.php\",\"Line\":49}","level":3,"time":"2016-10-25T14:37:25+02:00","method":"GET","url":"\/index.php\/settings\/ajax\/checksetup","user":"admin"}`

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [November 6, 2024, 8:50pm UTC](https://help.nextcloud.com/t/using-proxy-server-within-nextcloud/3718/6 "2024-11-06T20:50:55Z")

</div>

wwe: close old topics

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 3:22pm UTC](https://help.nextcloud.com/t/using-proxy-server-within-nextcloud/3718/7 "2024-12-04T15:22:16Z")

</div>


