直接在nginx.conf文件中多添加一个server即可
server { listen 80; server_name test.xxx.com; # 此处填写你分配的二级域名 location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Nginx-Proxy true; proxy_set_header Connection ""; proxy_pass http://127.0.0.1:8280; # 你本机的提供http服务的地址 }}