Unix 无限定向单倍体
我帮助处理了不幸,我开始学习与工作需要相关的haproxy。输入URL的任务是像我那样立即重定向到目录,但有一个问题,当单击链接并在重定向后,页面开始无限刷新或重定向。我附上我的haproxy的完整配置。haproxy-c-f/etc/haproxy/haproxy.cfgUnix 无限定向单倍体,unix,web,haproxy,Unix,Web,Haproxy,我帮助处理了不幸,我开始学习与工作需要相关的haproxy。输入URL的任务是像我那样立即重定向到目录,但有一个问题,当单击链接并在重定向后,页面开始无限刷新或重定向。我附上我的haproxy的完整配置。haproxy-c-f/etc/haproxy/haproxy.cfg apr30 12:55:12 localhost haproxy[3124]:192.168.1.92:53661[30/Apr/2020:12:55:12.000]https代理~1c_path/s10/0/15/9/24
apr30 12:55:12 localhost haproxy[3124]:192.168.1.92:53661[30/Apr/2020:12:55:12.000]https代理~1c_path/s10/0/15/9/24200 18570----2/1/0/0/0/0“GET/SoftOnIT/ru_-ru/HTTP/1.1”
也没有什么。。。
据我所知,http请求集路径/SoftOnIT/if 1c存在问题
我需要做一些类似于检查的事情-如果当前url已经是必需的,那么不要重定向。
有助于理解逻辑。
很抱歉谷歌翻译=)
您不仅需要检查主机头,还需要检查路径 我的建议
frontend https-proxy
bind *:443 ssl crt /etc/letsencrypt/live/my.server.ru/my.server.ru.pem
acl 1c hdr_end(host) -i my.server.ru
acl 1c_path path_beg /SoftOnIT
http-request redirect code 301 location https://%[req.hdr(host)]/SoftOnIT if !1c_path
use_backend 1c_path if 1c !1c_path
default_backend 1c_web
您不仅需要检查主机头,还需要检查路径 我的建议
frontend https-proxy
bind *:443 ssl crt /etc/letsencrypt/live/my.server.ru/my.server.ru.pem
acl 1c hdr_end(host) -i my.server.ru
acl 1c_path path_beg /SoftOnIT
http-request redirect code 301 location https://%[req.hdr(host)]/SoftOnIT if !1c_path
use_backend 1c_path if 1c !1c_path
default_backend 1c_web
下午好,您的方法不会重定向到my.server.ru/SoftOnIT/=(IIS主页打开。在haproxy日志中:
haproxy[15307]:192.168.1.92:55558[07/May/2020:09:23:04.962]http代理http代理/0/-1/-1/-0 301 109--LR--2/2/0/0/0/0/0/0“GET/http/1.1”和haproxy[15307]:192.168.1.92:55561[07/May/2020:23:04.979]https proxy~1c_path/s1 0/0/14/5/19 200 938----3/1/0/0/0/0“GET/HTTP/1.1”
我已将重定向添加到/SoftOnIT下午好,您的方法不会重定向到my.server.ru/SoftOnIT/=(IIS主页打开。在haproxy日志中:haproxy[15307]:192.168.1.92:5555558[07/May/2020:09:23:04.962]http proxy http proxy/0/-1/-1/-1/-0 301 109--LR--2/2/0/0/0/0 0/0“GET/http/1.1”和haproxy[15307]:192.168.1.92:55561[07/May/2020:09:23:04.979]https proxy~1c_path/s10/14/5/19 200 938----3/1/0/0/0/0“GET/http/1.1”
我已将重定向添加到/SoftOnIT