You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

server 5 proxy timeout settings

I recently upgraded to Server 5.0.4 and then to 5.0.15. I host a number of websites and one of them uses an external server to obtain data and this can take a few minutes, depending on the search requested. This ran fine on previous versions of server but I was getting error 502 on Server 5.0.x due to the reverse proxy timing out before the external server had responded. On Server 5.0.4 I tried to avoid this by setting up a second Wi-Fi connector and setting Apache to listen for port 80 on the extra IP address and this worked. However as soon as I upgraded to 5.0.15, my settings were overwritten again and I was back to square one. It took me quite a long time to find a solution having tried adding ProxyTimeout statements in various places to no avail. Here's what finally worked for me.

In /library/server/Web/Config/proxy/apache_serviceproxy.conf I modified the generic ProxyPass statement right at the end of the VirtualHost *:80 section to add a timeout as follows:
ProxyPass / http://127.0.0.1:34580/ timeout=300
and this increased the default timeout to 5 minutes (300 seconds).

I hope this might help someone else with the same problem.

Mac mini, OS X El Capitan (10.11.1), Server 5.0.15

Posted on Nov 10, 2015 6:48 AM

Reply
27 replies

Jan 8, 2016 5:38 AM in response to Bosco1983

Thank you Bunnyfu and Bosco1983. This is a good temporary workaround. Those stored procedures are still causing it to run very slow, but at least the error dialog box isn't getting in the way.


If it starts slowing down, wait until everything shows idle after running this command before continuing:


sudo psql -U _devicemgr -d devicemgr_v2m0 -h /Library/Server/ProfileManager/Config/var/PostgreSQL -c "select state,query from pg_stat_activity;"

Jan 30, 2016 8:00 AM in response to Bosco1983

It lists current activity in the Postgres database. The timeouts are occurring because the database is overloaded due to an inefficient stored procedure. By monitoring activity you can check to see when the load has dropped far enough to continue using the web interface. Basically if everything lists as idle then performance should be good again. The problematic stored procedures are related to VPP. It appears to have gotten worse after device assignment was added. They are called to get license counts for apps at the user, group, device, or device group levels. The apps section only gets the overall license counts which have no performance impact.

Aug 9, 2016 3:21 AM in response to Richard Williams2

What hasn't been said is that whenever the proxy settings are changed, the proxy service must be restarted. This is not the same as restarting the web service. One way to do this is a Restart, obviously. The other way is to execute the command

sudo /Applications/Server.app/Contents/ServerRoot/usr/sbin/serviceproxyctl restart


If the proxy server is not restarted none of the ProxyPass settings will be active.

Nov 21, 2016 5:43 PM in response to Richard Williams2

This issue has been driving me insane for the last couple of weeks (since I upgraded from Mavericks, to El Capitan to Sierra). I have a website that is very mySQL intensive and needs more than 90 seconds to complete some queries. I tried all suggestions posted here and none worked. Not giving up I noticed a file named /Library/Server/Web/Config/Proxy/apache_serviceproxy_customsites.conf, I opened it with nano and there was my custom website domain with the following:


<VirtualHost *:80>

ServerName www.customDomain.com:80

ServerAlias customDomain.com

ProxyPreserveHost On

SetEnv proxy-chain-auth on

RequestHeader set X-Forwarded-Proto "http"

RequestHeader set X-Forwarded-Port "80"

# default proxy command

ProxyPass / http://127.0.0.1:34580/

ProxyPassReverse / http://127.0.0.1:34580/

</VirtualHost>


So I changed the ProxyPass to the following:

ProxyPass / http://127.0.0.1:34580/ timeout=300 connectiontimeout=300 KeepAlive=On


So far so good. I will update with any news but it seems that changing ProxyPass anywhere else did apply to my website.

server 5 proxy timeout settings

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.