0

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=http://192.168.1.64/magento --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;
  server_name http://192.168.1.64: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

2

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 - 127.0.0.1:9000

2

Your Answer

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

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