Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, I want to thank Geoff and darkliquid. I took what was in darkliquid's link and worked on it to make it work for my case. The big challenge was that I wasn't serving the rails application from the root of the webserver.</p> <p>Notes:</p> <ul> <li><code>thin</code> is run with <code>--prefix '/railsapp'</code> on port 9999.</li> <li>This works for windows and linux. W00T!</li> <li>I have to use the <code>LA-U</code> (look-ahead) to get the final filename apache would use.</li> <li>The <code>IS_SUBREQ</code> check is to prevent the look-ahead (a sub request) from ever returning the proxy.</li> <li>The <code>/railsapp/index.html</code> rewrite is required because otherwise another rule in my apache conf would rewrite it to <code>/index.html</code>, which is a default 'here's what's here' page; <code>404</code>s are served elsewhere, though.</li> </ul> <p>Here's the relevant part of the apache configuration:</p> <pre><code># Only proxy the thin stuff. &lt;Proxy /railsapp/*&gt; Order deny,allow Allow from all &lt;/Proxy&gt; ## Add an alias for filename mapping. Alias /railsapp "/website/root/railsapp/public" ## We need the Rewrite Engine for this. RewriteEngine on &lt;IfDefine debug&gt; ## If debugging, turn on logging. RewriteLogLevel 9 RewriteLog "/website/logs/http.rewrite.log" &lt;/IfDefine&gt; ## Check for a static root page. RewriteRule ^/railsapp/?$ /railsapp/index.html [QSA] ## Check for Rails caching. RewriteRule ^(/railsapp/[^.]+)$ $1.html [QSA] ## Redirect all non-static requests to Rails. # Don't proxy on sub-requests (needed to make the LA-U work). RewriteCond %{IS_SUBREQ} false # Use look-ahead to see if the filename exists after all the rewrites. RewriteCond %{LA-U:REQUEST_FILENAME} !-f # Proxy it to Rails. RewriteRule ^/railsapp(.*)$ http://127.0.0.1:9999%{REQUEST_URI} [P,QSA,L] ## Make sure Rails requests are reversed correctly. ProxyPassReverse /railsapp http://127.0.0.1:9999/railsapp ## Disable keepalive; railsappd doesn't support them. SetEnv proxy-nokeepalive 1 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload