Re: [users@httpd] configuring a proxy fallback

2018-05-21 Thread John Bazik
> OK, was just a POC though, you probably need more to avoid infinite

Yeah, I spoke too soon.  I thought I had it working.  The syntax
for doing this is a bit too tortured.

John

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] configuring a proxy fallback

2018-05-18 Thread John Bazik
> Doesn't ErrorDocument to a proxied path work? Something like:
> 
> ProxyErrorOverride on
> ErrorDocument 404 /internal_404/
> ProxyPass /internal_404/ http://legacy_site/whatever/
> ProxyPassReverse /internal_404/ http://legacy_site/whatever/

Wow, thanks!  I assumed that "local url" in the docs meant no.
That works exactly as I want it to.

John

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] configuring a proxy fallback

2018-05-18 Thread John Bazik
> I wonder if, as a workaround, you might use an errordocument that
> converts 404 to 301 or 302, and redirects to $static/$request_uri?

Even if that works, it has to be an internal redirect.

John

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] configuring a proxy fallback

2018-05-17 Thread John Bazik
> A bit of an ugly hack (and probably not useful), but what about an
> errordocument that uses SSI to include your contents?

Mmm.  I don't want to go there.

> Would you be able to share the nginx config to achieve what you're
> looking for, as a reference point?

Sure.  Condensing it, the basic idea is this;

location / {
uwsgi_pass cms;
include uwsgi_params;
uwsgi_intercept_errors on;
error_page 404 = @fallback;
}
location @fallback {
try_files $uri @static;
}
location @static {
proxy_pass  http://static/$request_uri;
}

John

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] configuring a proxy fallback

2018-05-17 Thread John Bazik
> Oh I see, I didn't realize legacy was also proxied.  Maybe
> ProxyErrorOverride helps with one of the options?

That lets me use ErrorDocument on the proxy, but it doesn't
let me redirect the original request to the legacy site.

John

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] configuring a proxy fallback

2018-05-17 Thread John Bazik
> FallBackResource may be one option. Another might be the "lookahead"
> feature in mod_rewrite. Another is to poke and prod with -d/-f tests
> in mod_rewrite if you can determine that way.

All of those respond to a missing file, not a 404 returned from a
proxied request.  That's where I keep hitting a wall.

John

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] configuring a proxy fallback

2018-05-17 Thread John Bazik
Here's something I think I can't do with apache.

I have a uwsgi backend server and a legacy http server.  I would like a
reverse proxy that puts the dynamic site "in front of" the legacy site,
such that 404s from the former are internally redirected to the latter.

We have this implemented in nginx, but I recently needed to switch the
proxy to apache.  ErrorDocument is the obvious hook, but it has to be
a local url.  I've looked at the rewrite engine and balancer groups,
and I haven't found any way to do this.  I was about ready to give up
and thought I'd see if smarter people than me have an answer.

John

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org