0

After successfully install magento 2.3.3 in centos 7 with nginx, url getting Unable connect error.

Install nginx

Configure nginx

Install magento 2.3 using following commands,

php bin/magento setup:install --base-url=http://localhost/magento2 --db-host=localhost --db-name="magento2" --db-user="root" --db-password="" --admin-firstname="abc" --admin-lastname="abc" [email protected] --admin-user="magento2" --admin-password="magento2123" --language="en_US" --currency="INR" --timezone="Asia/Kolkata" --use-rewrites="1"

Configure SELinux and Firewalld

/etc/nginx/conf.d/magento.conf

upstream fastcgi_backend {
 server unix:/run/php-fpm/php-fpm.sock;
}
server {
 listen 8091;
 server_name 192.168.1.64;
 set $MAGE_ROOT /usr/share/nginx/html/magento2;
 include /usr/share/nginx/html/magento2/nginx.conf.sample;
}

If i try the url : 19.168.1.64:8091 getting error like Unable connect error

Anything else i missed?

asked Dec 27, 2019 at 12:09
2
  • 502 is cause due to a php issue, check your php version compatibility and also cross check required php extensions for magento 2.3.3 Commented Dec 27, 2019 at 12:19
  • @ASQ Check with my updated post my php version : 7.1.33 Commented Dec 27, 2019 at 12:28

1 Answer 1

0

correct way installing to localhost is:

  1. add your domain to hosts file: 192.168.1.64 myshop.com
  2. change magento base url as:

    php bin/magento setup:store-config:set --base-url="http://myshop.com/" php bin/magento setup:store-config:set --base-url-secure="https://myshop.com/" php bin/magento cache:flush

  3. add domain name to nginx config: listen 8091; server_name myshop.com;

open your browser with: http://myshop.com/

this is it.

answered Dec 29, 2019 at 13:12
3
  • I just testing with local host, intstead of "myshop.com" shall i use "localhost/magento2"? Commented Dec 30, 2019 at 5:03
  • @ vim /etc/nginx/conf.d/magento.conf justpaste.it/3me3h Commented Dec 30, 2019 at 5:13
  • domain name and base url must be the same, you can use your base url as: http://192.168.1.64:8091/ but better option to avoid using localhost in base url and even subfolder. Commented Dec 30, 2019 at 9:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.