我有一个上游服务器处理我们网站的登录。成功登录后,我想将用户重定向到站点的安全部分。在登录失败时,我想将用户重定向到登录表单。
上游服务器200 OK
在登录成功和401 Unauthorized
登录失败时返回。
这是我的配置的相关部分:
{
error_page 401 = @error401
location @error401 {
return 302 /login.html # this page holds the login form
}
location = /login { # this is the POST target of the login form
proxy_pass http://localhost:8080;
proxy_intercept_errors on;
return 302 /secure/; # without this line, failures work. With it failed logins (401 upstream response) still get 302 redirected
}
}
Run Code Online (Sandbox Code Playgroud)
此设置在成功登录时有效。客户端使用 302 重定向。这在登录失败时不起作用。上游服务器返回 401,我预计它error_page
会启动。但我仍然得到 302。如果我删除该return 302 /secure/ …
首先,我有一个特殊的 IPv6 地址分配给我的专用服务器,只有 1。一个 ::1/128 一个。但我可以为 eth0 分配地址(例如:::2/128、::3/128 等)。
现在我想在该服务器上运行 LXC 容器,但我希望它们成为一等公民,我希望它们拥有自己的 IPv6 地址。
带有 IPv4 的 LXC 工作正常。我可以启动一个容器,并从中 ping 世界。我有一个名为lxcbr0
.
老实说,我不知道如何继续。在我的特定 LXC 配置中(“前缀”代表我分配的前缀):
lxc.network.ipv6 = prefix::3/128
lxc.network.ipv6.gateway = prefix::2 # iffy, not sure this is correct
Run Code Online (Sandbox Code Playgroud)
在主机上,我已将 sysctl 配置为使用转发:
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.eth0.forwarding = 1
Run Code Online (Sandbox Code Playgroud)
现在我迷失了方向。我想我需要为网桥分配一个 IP。我已经为它分配了前缀::2/128,这是我在上面的 LXC 配置中使用的。在“界面”中:
iface lxcbr0 inet6 static
address prefix::2
netmask 128
# use arp proxy? Read that somewhere.
post-up /sbin/ip -6 neigh add proxy prefix::3 dev eth0 …
Run Code Online (Sandbox Code Playgroud)