skip to Main Content

I’m using Magento 2.4 and when I’m trying to connect to my Magento 2 domain on localhost, I get the default Nginx page.

This is the Nginx conf file in /etc/nginx/sites-available and I created a soft link of this file in the /etc/nginx/sites-enabled directory

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

server {

  listen 80;
  server_name www.edu.ubuntu.com;
  set $MAGE_ROOT /var/www/project-community-edition;
  set $MAGE_MODE developer;
  include /var/www/project-community-edition/nginx.conf.sample;
}

I added this to /etc/hosts file

127.0.0.1       edu.ubuntu.com

This is my web/unsecure/base_url in the core_config_data

http://edu.ubuntu.com/

But I’m still getting Nginx default page when I’m trying to enter http://edu.ubuntu.com. Could anyone help me? Any kind of help would be appreciated

2

Answers


  1. Chosen as BEST ANSWER

    Looks like default conf file was also listening to 80. I just moved that file away from there and everything works now.


  2. 127.0.0.1 edu.ubuntu.com

    Remove this line in etc/hosts
    then run sudo service nginx restart

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search