Second-level domain name access without port number

1. Second-level domain name access without port number

1. Create the xxx.conf file in the nginx/conf.d folder

2. Make file configuration

server
{
        listen 80;
        server_name api.test.com; 
        location / {
                proxy_redirect off;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass http://localhost:8080;
        }
}

Guess you like

Origin blog.csdn.net/qq_44255146/article/details/115142407