mod_重写apache反向代理(重定向到内部链接)

mod_重写apache反向代理(重定向到内部链接),apache,mod-rewrite,url-rewriting,Apache,Mod Rewrite,Url Rewriting,我尝试将类似https://?do_something的URL重定向到https://?do_other_something 如果被调用的URL不包含,请执行以下操作。 意思是:https://的呼叫应该重定向到https://?做其他事情 我试着用外部URL获取这个,效果很好。但是对于URL,它们是由我们的反向代理管理的,而不是,我们得到了一个无休止的循环 我的配置: # test rewrite <VirtualHost *:443> # General s

我尝试将类似https://?do_something的URL重定向到https://?do_other_something 如果被调用的URL不包含,请执行以下操作。 意思是:https://的呼叫应该重定向到https://?做其他事情

我试着用外部URL获取这个,效果很好。但是对于URL,它们是由我们的反向代理管理的,而不是,我们得到了一个无休止的循环

我的配置:

# test rewrite

<VirtualHost *:443>

        #  General setup for the virtual host
        #DocumentRoot "/srv/www/htdocs"
        ServerName <mydomain>.de
        #ServerAdmin webmaster@example.com
        ErrorLog /var/log/apache2/<domain>_error_log
        TransferLog /var/log/apache2/<domain>i_access_log

        RequestHeader unset Cookie
       
        #   SSL Engine Switch:
        #   Enable/Disable SSL for this virtual host.
        SSLEngine on

        RewriteEngine on
        SSLProxyEngine on
        RewriteCond %{QUERY_STRING} !\?do_something.*
        RewriteRule ^(.*)$ https://<URL what is handled by this proxy>?do_other_things [P]
        # external URL works fine
        #RewriteRule ^(.*)$ https://www.google.de/maps/ [R=302,L]
       
        #   You can use per vhost certificates if SNI is supported.
        SSLCertificateFile <location_to_cert>
        SSLCertificateKeyFile <location_to_key>
        SSLCertificateChainFile <location_to_root_ca>

        #reverse proxy url to internal webserver
        ProxyPass / http://192.168.1.50:8099/
        ProxyPassReverse / http://192.168.1.50:8099/
       
        #   Per-Server Logging:
        #   The home of a custom SSL log file. Use this when you want a
        #   compact non-error SSL logfile on a virtual host basis.
        CustomLog /var/log/apache2/request_log   ssl_combined

</VirtualHost>
# end test rewrite
#测试重写
#虚拟主机的常规设置
#DocumentRoot“/srv/www/htdocs”
ServerName.de
#服务器管理员webmaster@example.com
ErrorLog/var/log/apache2/\u错误\u日志
传输日志/var/log/apache2/i\u访问日志
请求头未设置Cookie
#SSL引擎交换机:
#为此虚拟主机启用/禁用SSL。
斯伦金安
重新启动发动机
SSLProxyEngine打开
重写条件%{QUERY\u STRING}!\?做点什么*
重写规则^(.*)$https://?做其他事情[P]
#外部URL工作正常
#重写规则^(.*)$https://www.google.de/maps/ [R=302,L]
#如果支持SNI,您可以使用per vhost证书。
SSL证书文件
SSLCertificateKeyFile
SSLCertificateChainFile
#将代理url反转到内部Web服务器
ProxyPass/http://192.168.1.50:8099/
ProxyPassReverse/http://192.168.1.50:8099/
#每服务器日志记录:
#自定义SSL日志文件的主目录。当你想要一张照片时就用这个
#基于虚拟主机压缩无错误SSL日志文件。
CustomLog/var/log/apache2/request\u log ssl\u组合
#结束测试重写
错误日志显示:

[Wed Oct 21 20:28:06.738679 2020][proxy_http:error][pid 5091](103)软件导致连接中止:[client 192.168.1.15:44566]AH01102:从远程服务器读取状态行时出错:443


[Wed Oct 21 20:28:06.738723 2020][proxy:error][pid 5091][client 192.168.1.15:44566]AH00898:error/HTTP_BAD_GATEWAY.html.var返回的远程服务器读取错误您问题的第一句话不清楚:首先,您说您想以
https://?dou something
,然后你说它不应该包含
?做点什么