There are use-cases where you may want to access your Dashboard from both the IP address as well as the domain. In order to accomplish this you simply need to edit the default nginx config. Read on to learn how to stop the IP of your server from redirecting to the domain and to be able to access your server from both its IP as well as the domain.
First, edit the nginx default config.
The file you will want to change is the actual server block located at/etc/nginx/site-enabled/default
. From inside this file you will see the location /
block you’re after.
Just change from the following:
location / { return 301 https://$host$request_uri; }to the below:
location / { #return 301 https://$host$request_uri; return 444; }
Finally, restart the web server.
Afterwards justservice nginx restart
and voila, you can now access your dashboard via both IP and domain.