类似下面这样配置就可以了 server { listen 80; server_name 1.1.1.1; root /web/data; .... } 未经允许不得转载:肥猫博客 » 如何设置nginx可以让ip可以直接访问网站