nginx用于本地开发

我想用nginx进行本地开发。 这意味着我想阻止其他机器访问我的Web服务器,因此只能通过本地主机访问。

在sites-enabled / default的服务器设置下,我将代码更改为

location / { # First attempt to serve request as file, then # as directory, then fall back to index.html allow 127.0.0.1; deny all; try_files $uri $uri/ /index.html; } 

还有什么我需要做的,以防止第三方访问我的networking服务器?

在NGINX方面,根据您希望的安全程度,您可能还希望从本地主机以外的任何IP(或者使用非默认端口)阻止端口80(或者运行NGINX的任何端口) 8000-10000范围)。