Skip to content

Magento2 doesn’t load in Browser after fresh install and successful nginx config test

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>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<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>

</body>
</html>

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 MagentoFrameworkAppHttpInterceptor does not exist