gpt4 book ai didi

apache - 仅当文件不存在时才使用代理

转载 作者:行者123 更新时间:2023-12-02 10:15:29 24 4
gpt4 key购买 nike

我尝试通过 Apache 代理将访问者传递到界面。这有效。为了自定义界面(CSS、图像等),我们希望能够覆盖远程服务器上的文件。这是我们的代码:

RewriteEngine on
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) https://.../$1 [P,L]

在 Apache 的文档根目录中,有一个 css/style.css 等文件。但是在网络浏览器中请求此信息,它会显示通过代理获取的网站版本。我们尝试了一些方法但没有成功。

最佳答案

通过排除已知的 css/js/image 扩展来尝试此规则:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\.(?:jpe?g|gif|bmp|png|ico|tiff|css|js)$ [NC]
RewriteRule (.*) https://example.com/$1 [P,L]

关于apache - 仅当文件不存在时才使用代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38916946/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com