如何解决Apache virtualhost-仅在文件/文件夹不存在时重写代理密码
我有一个Java 'mother'应用程序( proxypass ),该应用程序基于{{1} }。
我使用域名将对该域根目录的调用重定向到相应的'child'应用。
我正在使用“让我们加密证书”以允许使用https,因此我有一个批处理文件来更新证书。
该批处理将质询文件保存在L.E需要访问的适当文件夹中。验证过程。
我正试图让L.E.访问这些文件。如果(仅)网址直接指向它们。在任何其他情况下,我都希望根据域重定向到正确的'child'应用。
我当前用于域/系统的虚拟主机条目如下:
.../open.do?action=open&sys=TST
但是,即使我尝试访问<VirtualHost test.io:80>
ServerAdmin webmaster@test.ig
ServerName test.io
ServerAlias test.io
# Force SSL
Redirect permanent / https://test.io/
ErrorLog "logs/test.io-error.log"
CustomLog "logs/test.io-access.log" common
LogLevel alert rewrite:trace6
</VirtualHost>
<VirtualHost test.io:443>
SSLEngine on
SSLCertificateFile c:\le64\test.io\test.io.crt
SSLCertificateKeyFile c:\le64\test.io\test.io.key
ServerAdmin webmaster@test.io
ServerName test.io
ServerAlias test.io
# Rewrite to make L.E. challenge files visible
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}/.well-known/acme-challenge/$1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/.well-known/acme-challenge/$1 -d
RewriteRule (.*) - [L]
# Else Rewrite to open the right SYS (Need sys=XXX Value)
RewriteCond "%{REQUEST_URI}" "!^/webrunstudio/.*$"
RewriteRule "^/?(.*)" "/webrunstudio/open.do?action=open&sys=TST" [L,R,NE]
#
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ErrorLog "logs/test.io-error.log"
CustomLog "logs/test.io-access.log" common
</VirtualHost>
上的现有文件,我的第二条规则也会覆盖第一条规则。
这可以防止L.E.验证文件的存在,因此我需要手动/临时更改虚拟主机条目,重新启动apache等...
谢谢您的评论。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。