开发者

apache ProxyPassMatch .htaccess issue

In a virtualhost environment, I have apache proxying static content to a lighttpd backend for performance, and also to bypass mod_security performance hits on static content using the following ProxyPassMatch statement:

ProxyPassMatch (? < ! \ .php|.pl|cgi|htm|html|shtml|/)$ http : // 127.0.0.1:35436/

(:35436 is my lighttpd port)

This setup works well to proxy anything that isn't any of the above to lighttpd. My issue is, as I've just uncovered, that Custom ErrorDocuments don't work very well.

The .htaccess is the simple: ErrorDocument 404 /404.htm

For example a 404 on foo.com/bar.htm works as it's开发者_运维百科 handled by apache / .htaccess foo.com/bar does not work, the 404 goes via lighttpd foo.com/bar/ does work as it's handled by apache / .htaccess (assumed /index.*)

I know the syntax to add 404s to the lighttpd configuration but as it's a virtualhost environment I'd like the user to be able to control this via a single .htaccess file.

Is there any way to force apache to deal with 404s (and the other standard error pages) rather than obeying its own ProxyPassMatch statement?

Many thanks


Try to use:

ProxyErrorOverride On

To use apache 404 response when a 404 header is in the response from lighthttpd.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜