如何解决mod_rewrite apache反向代理重定向到内部链接
我尝试将 https://
我尝试使用外部URL来获得此功能,效果很好。但是使用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
错误日志说:
[2020年10月21日星期三20:28:06.738679] [proxy_http:error] [pid 5091](103)软件导致连接中止:[客户端192.168.1.15:44566] AH01102:从远程服务器:443读取状态行时出错
[2020年10月21日星期三20:28:06.738723] [proxy:error] [pid 5091] [client 192.168.1.15:44566] AH00898:从/error/HTTP_BAD_GATEWAY.html.var返回的远程服务器读取错误>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。