你可以通过nginx.conf配置中http段进行配置:For example, using this nginx.conf: events { worker_connections 1024; } http { resolver 4.2.2.4; server { listen 8080; location / { proxy_pass http://$http_host$request_uri; } } }