I’m installing a magento on my local ubuntu vm to play around with it. I have successfully installed it but accessing it with local domain is not working.
I have added xyz.com as local domain in the ngix config as below.
server unix:/run/php/php8.1-fpm.sock;
}
server {
server_name xyz.com;
listen 80;
set $MAGE_ROOT /var/www/magento;
set $MAGE_MODE developer; # or production
access_log /var/log/nginx/magento-access.log;
error_log /var/log/nginx/magento-error.log;
include /var/www/magento/nginx.conf.sample;
}
And in the magento installation, I hav set the base-url to xyz.com as well.
sudo -u www-data bin/magento setup:install --base-url=http://xyz.com --db-host=localhost --db-name=mydb --db-user=myuser --db-password=mypass --admin-firstname=admin --admin-lastname=admin [email protected] --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=elasticsearch7 --elasticsearch-host=http://localhost --elasticsearch-port=9200 --elasticsearch-index-prefix=magento2 --elasticsearch-timeout=15 --elasticsearch-enable-auth=0
But when I try to access xyz.com from the browser, instead of my magento website, it goes to the actual xyz.com from the internet.
Did I miss anything to be configured?