实例


server
{
  resolver 8.8.8.8;
  listen 82;
  location /
  {
      proxy_pass http://$http_host$request_uri;
  }
}
  • 设置DNS服务器地址为8.8.8.8,使用默认的53端口作为DNS服务器的服务端口

  • 代理服务的监听端口设置为82端口

  • Nginx服务器接收到的所有请求都由第5行的location块进行过滤处理

Last updated

Was this helpful?