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.
The documentation on using Apache with the Racket Web Server currently recommends
mod_rewrite:web-server/web-server-doc/web-server/scribblings/server-faq.scrbl
Lines 7 to 29 in e321f84
However, the extended documentation for
mod_rewritelists Simple Proxying as an example of when not to usemod_rewrite: it recommendsProxyPassfrommod_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.