加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

nginx用于本地开发

发布时间:2020-12-13 21:19:55 所属栏目:Nginx 来源:网络整理
导读:我想使用nginx进行本地开发.这意味着我想阻止其他机器访问我的Web服务器,因此只能通过localhost访问它. 在sites-enabled / default中的服务器设置下,我将代码更改为 location / { # First attempt to serve request as file,then # as directory,then fall b

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

在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;
    }

我还需要做些什么来阻止第三方访问我的网络服务器吗?

最佳答案
在NGINX方面没有,根据你想要它的安全程度,你可能还想阻止来自除本地主机之外的任何IP的端口80(或任何运行NGINX的端口),或者使用非默认端口(Something in the 8000-10000范围).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读