编辑Nginx配置文件

vim /etc/nginx/nginx.conf

http {} 里添加如下代码

server {
    server_name www.test.com
    listen 80;

    location / {
        proxy_pass http://127.0.0.1:8080;
    }
}

重启Nginx

nginx -s reload