Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs shouldn't recommend mod_rewrite for Apache #127

Open
LiberalArtist opened this issue Jul 14, 2023 · 0 comments
Open

Docs shouldn't recommend mod_rewrite for Apache #127

LiberalArtist opened this issue Jul 14, 2023 · 0 comments

Comments

@LiberalArtist
Copy link
Contributor

The documentation on using Apache with the Racket Web Server currently recommends mod_rewrite:

@section{How do I use Apache with the Racket Web Server?}
You may want to put Apache in front of your Racket Web Server
application. Apache can rewrite and proxy requests for a private (or
public) Racket Web Server:
@verbatim{
RewriteEngine on
RewriteRule ^(.*)$ http://localhost:8080/$1 [P,NE]
}
The first argument to @exec{RewriteRule} is a match pattern. The second
is how to rewrite the URL. The bracketed part contains flags that
specify the type of rewrite, in this case the @litchar{P} flag instructs
Apache to proxy the request. (If you do not include this, Apache will
return an HTTP Redirect response and the client will make a second
request to @litchar{localhost:8080} which will not work on a different
machine.) In addition, the @litchar{NE} flag is needed to avoid
escaping parts of the URL --- without it, a @litchar{;} is escaped as
@litchar{%3B} which will break the proxied request.
See Apache's documentation for more details on
@link["http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule"]{RewriteRule}.

However, the extended documentation for mod_rewrite lists Simple Proxying as an example of when not to use mod_rewrite: it recommends ProxyPass from mod_proxy.

I was reminded of this while writing #126 (comment). I'm not sure if I have a working example to contribute at the moment (I'm in the midst of some configuration changes locally), but I'll send one if I do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant