After placed Magento 2.3.3 files to usr/share/nginx/html/magento & created database then run following,

php bin/magento setup:install --base-url= --db-host=localhost --db-name="magento" --db-user="root" --db-password="" --admin-firstname="abc" --admin-lastname="abc" [email protected] --admin-user="magento" --admin-password="magento" --language="en_US" --currency="INR" --timezone="Asia/Kolkata" --use-rewrites="1"

and also edit etc/nginx/conf.d/magento.conf

upstream fastcgi_backend {
  server unix:/run/php-fpm/php-fpm.sock;

server {

  listen 8091;
  set $MAGE_ROOT /usr/share/nginx/html/magento;
  include /usr/share/nginx/html/magento/nginx.conf.sample;

Screenshot : https://snipboard.io/K5t9Qm.jpg

How to solve 502 bad gateway error?

Note : <?php phpinfo(); ?> -> test.php inside /usr/share/nginx/html php info page return 502 bad gateway error.

1 Answer 1


you see this config part:

upstream fastcgi_backend {
  server unix:/run/php-fpm/php-fpm.sock;

this is where your php-fpm is listening. please check your php-fpm config, it must be the same socket path, with correct user read permissions. or change it to ip:port -

  • After updated in /etc/nginx/conf.d/magento.conf => justpaste.it/6oxl8 what is this error => justpaste.it/2jbsm
    – zus
    Commented Jan 18, 2020 at 7:22
  • this is not error, just debug message
    – MagenX
    Commented Jan 18, 2020 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.