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" --admin-email=abc@gmail.com --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.


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 -

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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