URL переписывания Haproxy - PullRequest
       13

URL переписывания Haproxy

0 голосов
/ 19 января 2020

У меня проблемы с переписыванием следующего URL

http://xxx.xxx.xxx.1/project_path/controller/controller.php?path=xxx33_? Param1 = 1¶m2 = 2¶m3 = 3

до

https://somedomain.com/firma01/xxx33_?param1=1&param2=2&param3=3

У меня есть haproxy 1.8.8 на Ubuntu 18.04.3


########################

frontend somedomain.com_http
bind xxx.xxx.xxx.xxx:80
no log
redirect scheme https code 301 if !{ ssl_fc }
use_backend webservers

frontend somedomain.com_https
bind xxx.xxx.xxx.xxx:443 ssl crt /etc/haproxy/certs/somedomain.com.pem
option forwardfor
no log
maxconn 83048
compression algo gzip
compression type text/css text/html text/javascript application/javascript text/plain text/xml application/json

acl path01 path_reg ^/xxx33_/(.*)$
acl letsencrypt-acl path_beg /.well-known/acme-challenge/

http-request set-path /index.html unless path01 OR letsencrypt-acl

reqirep (.*)/xxx33_/(.*) \1/project_path/controller/controller.php?path=\2

#reqadd X-Forwarded-Proto:\ http
use_backend letsencrypt-backend if letsencrypt-acl
use_backend webservers



backend webservers
balance roundrobin
    server ws1 xxx.xxx.xxx.1:80 check
    server ws2 xxx.xxx.xxx.2:80 check
    server ws3 xxx.xxx.xxx.3:80 check
option httpchk
option forwardfor

#######################

с правой структурой URL https://somedomain.com/firma01/xxx33_?param1=1&param2=2&param3=3

echo $ _GET

Array
(
    [path] => xxx33_?param1=1
    [param2] => 2
    [param3] => 3
)

Заранее большое спасибо за помощь

...