SECOND UPDATE: After reconfiguring file system permissions, and re-installing: It finally worked! This thread ended up being a self-help journey.

UPDATE: After doing a fresh install, increasing InnoDB buffer size, resolving all database permissions, regenerating Interceptor. I am STILL getting a blank page knowing that

  1. Ping to my domain routes successfully to my cloud IP
  2. Port 443 is open and working
  3. SSL Certificate is valid and working

VERY IMPORTANT: After resolving all the issues, I cleared my logs and visited the domain address in my browser. The page is blank and absolutely NO logs were generated other than the following in debug.log:

main.DEBUG: cache_invalidate:  {"method":"GET","url":"http:/","invalidateInfo":{"tags":["FPC"],"mode":"matchingTag"}} []

It's been 3 days I'm battling with this! I've learned more in these 3 days than in a life time about the Linux filesystem, webservers, database management, configuration! SECURITY!

But still can't solve this problem. HELP!

I successfully deployed the latest Magento 2.4.1 on Ubuntu 18.04, PHP, Nginx with letsencrypt cert.

Previously, when i visit my domain i was able to see the magento 2 welcome page. After having made the Command line installation successfully and got the unique link to admin panel, visiting magento through the browser is returning a server not found error.

When i send a GET request to local host (NOT https) from server side, it returns the following Nginx welcome page.

curl -XGET http://localhost

<!DOCTYPE html>
<title>Welcome to nginx!</title>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>


I am able to successfully ping my connected domain over the internet which returns the actual server IPv4 address

root@pc:~# ping domain.com
PING domain.com (xxx.xx.xxx.xx) 56(84) bytes of data.
64 bytes from xxx.xx.xxx.xx (xxx.xx.xxx.xx): icmp_seq=1 ttl=53 time=161 ms
64 bytes from xxx.xx.xxx.xx (xxx.xx.xxx.xx): icmp_seq=2 ttl=53 time=82.6 ms
64 bytes from xxx.xx.xxx.xx (xxx.xx.xxx.xx): icmp_seq=3 ttl=53 time=105 ms

If i ping my domain with "www." before it retuns the below

root@pc:~# ping **www**.domain.com
ping: www.domain.com: Name or service not known

Possible issues:

I have magento installed in var/www/ instead of var/www/html but i made the necessary changes in default.conf as well as nginx.conf and the sample configuration file in the magento2 filesystem configuration (nginx.conf.sample)

The solution may be something very simple that i missed, does anyone have an idea?

UPDATE: After re-installing Magento, I got a "Error has occured" page. The exception log returns the below error:

main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist

2 Answers 2


Did you configure /etc/nginx/sites-enabled/<<example.com>> properly? Check for values there, is it routing to right path for Magento application

Configure and test with command nginx -t Configure and restart nginx Check nginx status

  • Thanks for your comment! Does the configuration file name in /sites-enabled/ have to be the domain name? The /sites-enabled/ path is set 'var/www/' while my magento install is 'var/www/magento' should i change it to the latter? Edit: It is actually set to /var/www/magento, so I suppose the path is correct. Doesn't solve my problem
    – SRM92
    Commented Jan 19, 2021 at 15:01


Section you need to look at and give the right path to magento root folder which in your case is '/var/www/magento'

Configure nginx We recommend configuring nginx using the nginx.conf.sample configuration file provided in the Magento installation directory and an nginx virtual host.

These instructions assume you’re using the Ubuntu default location for the nginx virtual host (e.g., /etc/nginx/sites-available) and Ubuntu default docroot (e.g., /var/www/html), however, you can change these locations to suit your environment.

Edit /etc/nginx/sites-available/magento and add following code, remember to replace php version, server name and path to Magento directory

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

server {

listen 80; server_name www.magento-dev.com; set $MAGE_ROOT /var/www/html/magento2; include /var/www/html/magento2/nginx.conf.sample; }

  • Thanks for the time put on this. I had already carefully configured it as you mentioned so I'm assuming it's something else. I am now doing a fresh install all over again, will let yo know! Thanks
    – SRM92
    Commented Jan 20, 2021 at 14:21
  • I just carefully read your 1st post, you mentioned you are getting server not found error, is there any error code - there should be either error from Nginx or from Magento directory. If none then check your firewall setting is https, nginx full is enabled as you are routing traffic through port 443, it should be enabled as well - I am assuming you are using cloud server many a times port 443 is not enabled for the IP, confirm that as well.
    – Gaurav
    Commented Jan 20, 2021 at 14:30
  • Hi, so far I've successfully reached this stage. It means for sure that nginx is working and properly configured with SSL. The problem is taking place after i actually make the magento installation. imgur.com/a/rQBZiA0
    – SRM92
    Commented Jan 20, 2021 at 16:27

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.