Custom domain name cannot be accessed using nginx configuration on mac

server {
    listen 8080;
    server_name gyxyl.com;
    location / {
        proxy_pass http://localhost:8081;
    }
}

this is the

that I configured in nginx.
127.0.0.1 gyxyl.com

this is configured by me in hosts, but accessing gyxyl.com shows that I cannot access

Mar.22,2021

try visiting gyxyl.com:8080?

< hr >

listen is usually followed by a port number, so you have created a listener on port 8080. For more information, please see configuration introduction

.
Menu