Call Us! 1-800-383-5193
Call Us! 1-800-383-5193
Call Us! 1-800-383-5193

Need Help?

Emergency Response Time custom

Our experts have had an average response time of 11.06 minutes in March 2021 to fix urgent issues.

We will keep your servers stable, secure and fast at all times for one fixed price.

Vestacp 502 bad gateway – How we fix

by | Feb 3, 2021

Stuck with Vestacp 502 bad gateway? We can help you.

Vestacp 502 bad gateway issue occurs mainly due to lack of disk space or vesta session problems.

VestaCP is an open-source web control panel that is considered to be a great alternative to cPanel.

At Bobcares, we often receive requests from our customers to solve Vestacp errors as part of our Server Management Services.

Today, let’s see how our  Support Engineers fix this gateway error for our customers.


Methods to fix Vestacp 502 bad gateway

Some of the common causes for Vestacp 502 bad gateway includes disk space issue, vesta session problem or even PHP-fpm service issues. Let’s see how our Support Techs fix this for our customers.


1. Lack of Disk Space

One of the most common reasons for this error is the disk space issue.

When disk space reaches the limit the Vestacp returns 502 gateway error.

To fix this we will check the disk space usage and availability using the below command:

df -h

If we notice the storage to be full, we can delete some unnecessary files and folders to increase the available space.

This is one way to fix this gateway error.


2. Vesta Session problem

We will delete the current vesta session folder to fix this.

The steps to follow are:

1. SSH to the server.

2. Then delete /usr/local/vesta/data/sessions folder using the following command:

rm -R /usr/local/vesta/data/sessions

3. Next we will create a new session folder using the following command:

mkdir  /usr/local/vesta/data/sessions

4. After that, we will set the permission to 775 for the folder using the following command:

chmod -R 775 /usr/local/vesta/data/sessions

5. And we will change the owner of the folder to admin: admin with the following command:

chown -R admin: admin /usr/ local/vesta/data/sessions

6. After that, we check the file  /usr/local/vesta/php/etc/php-fpm.confand make sure the file path.

php_admin_value [session.save_path] = /usr/local/vesta/data/sessions

7. Now we will edit the file /usr/local/vesta/php/etc/php-fpm.conf  by adding the following lnes:

vi /usr/local/vesta/php/etc/php-fpm.conf
php_admin_value [memory_limit] = 256M
php_admin_value [post_max_size] = 512M
php_admin_value [upload_max_filesize] = 512M
php_admin_value [max_execution_time] = 600
php_admin_value [max_input_time] = 600
php_admin_value [session.save_path] = /usr/local/vesta/data/sessions

8. Finally, we will restart the vesta service.

vesta service restart


3. Restarting the PHP-fpm service.

At times, the PHP-fpm service causes this 502 gateway time out error. So we will try restarting the service using the following command:

service php-fpm restart

[Still, stuck with this error?- We’ll help you.]



To conclude, we saw some of the common causes for Vestacp 502 bad gateway and the steps our Support Engineers follow to fix this.


Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.


var google_conversion_label = "owonCMyG5nEQ0aD71QM";


Submit a Comment

Your email address will not be published. Required fields are marked *

Privacy Preference Center


Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]


Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid


Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie


These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.