我有一个nginx代理链接到所有我的usenet程序,全部锁定在http basic auth。
之后我想在某些具有静态IP的设备上绕过auth。我试过添加"允许"而它似乎没有工作。
根据这个设置我应该把它放在哪里
CREATE TABLE [dbo].[Items] (
[Id] BIGINT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (100) NOT NULL,
[Description] NVARCHAR (1000) NULL,
[Price] DECIMAL (18, 2) NOT NULL,
[Currency] INT NOT NULL,
[Negotiable] BIT NOT NULL,
[CategoryId] TINYINT NOT NULL,
[Category_Id] INT NULL,
[OwnerId] NVARCHAR (128) DEFAULT ('') NOT NULL,
CONSTRAINT [PK_dbo.Items] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_dbo.Items_dbo.Categories_Category_Id] FOREIGN KEY ([Category_Id]) REFERENCES [dbo].[Categories] ([Id]),
CONSTRAINT [FK_dbo.Items_dbo.AspNetUsers_OwnerId] FOREIGN KEY ([OwnerId]) REFERENCES [dbo].[AspNetUsers] ([Id]) ON DELETE CASCADE)
答案 0 :(得分:3)
auth_basic可以接受变量,geo模块的工作方式类似于基于IP的map,因此您可以尝试这样的事情:
geo $auth_bypass {
192.168.1.0/24 "off";
default "closed site";
}
...
auth_basic $auth_bypass;