So I'm messing around with using nginx's xsendfile. I have the proxy setup and its working fine. And I have the following in the config to serve the static files:<div><br></div><div><div>location /files {</div><div>
root /var/www;</div><div> internal;</div><div>}</div></div><div><br></div><div>The proxying works fine and when I make a request to the nginx server it properly ends up going to the Webmachine server, which dispatch rule sends it to my resource for static files. Here I return:</div>
<div><br></div><div><div>NewReqData = wrq:set_resp_header("X-Accel-Redirect", "/files/test.html", ReqData),</div><div>{"", NewReqData, Ctx}.</div><div><br></div><div>But this does not work to end up having nginx serve up test.html from /var/www. Should it? Am I doing it completely wrong? Any suggestions?</div>
<div><br></div><div>Thanks,</div><div>Tristan</div><br><div class="gmail_quote">On Wed, Jul 20, 2011 at 6:51 PM, Kenny Stone <span dir="ltr"><<a href="mailto:kennethstone@gmail.com">kennethstone@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">One way to look at it is that Erlang has (more powerful) versions of redis/memcached built in with ETS and Mnesia. These are pretty nice features for web development, and I'm always a fan of cutting down the external dependencies for deployment and dev. Just rebar your repo and you get this powerful, self-contained web server executable (one of the selling points of couchdb, actually).<div>
<br></div><div><font color="#888888">Kenny</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Wed, Jul 20, 2011 at 6:38 PM, Tristan Sloughter <span dir="ltr"><<a href="mailto:tristan.sloughter@gmail.com" target="_blank">tristan.sloughter@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Kenny, yeah, thats what I was thinking of doing as a cache method if I couldn't use something easily in front of Webmachine like Varnish (didn't actually think of Varnish until Jesper brought it up. Maybe a bit of both... Since while I don't want to use any templating on the backend, I want to end up with a general web framework from all this.<div>
<br></div><div><font color="#888888">Tristan</font><div><div></div><div><br><br><div class="gmail_quote">On Wed, Jul 20, 2011 at 3:47 PM, Kenny Stone <span dir="ltr"><<a href="mailto:kennethstone@gmail.com" target="_blank">kennethstone@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I wonder if an ets solution wouldn't be as good, as these solutions are just going to find some way of holding the data in memory anyways. WIth ets, you can do things like hold compiled erlydtl/mustache templates inside of it...<div>
<br></div><div><font color="#888888">Kenny</font><div><div></div><div><br><br><div class="gmail_quote">On Tue, Jul 19, 2011 at 11:47 AM, Garrett Smith <span dir="ltr"><<a href="mailto:g@rre.tt" target="_blank">g@rre.tt</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If you're already using Nginx and just want control over URLs, you<br>
have access to the standard rewrite module:<br>
<br>
<a href="http://wiki.nginx.org/HttpRewriteModule" target="_blank">http://wiki.nginx.org/HttpRewriteModule</a><br>
<br>
This is not 30x redirection btw, unless of course you want that.<br>
<br>
On Tue, Jul 19, 2011 at 9:24 AM, Tristan Sloughter<br>
<div><div></div><div><<a href="mailto:tristan.sloughter@gmail.com" target="_blank">tristan.sloughter@gmail.com</a>> wrote:<br>
> Sam, Jesper both these sound great, thanks! I'm also going to look into what<br>
> Jack was saying about how Rails handles some stuff.<br>
> But I'm leaning towards Jesper's idea with Varnish being the best... I'm one<br>
> of those people who scoff at most benchmarks so not sure I'll bother to do<br>
> one for this, but maybe, if someone here can A) suggest the best setup for<br>
> it B) if it makes sense at all or would just be another worthless benchmark<br>
> that really gives no information about reality.<br>
> Thanks!<br>
> Tristan<br>
> On Tue, Jul 19, 2011 at 7:00 AM, Jesper Louis Andersen<br>
> <<a href="mailto:jesper.louis.andersen@gmail.com" target="_blank">jesper.louis.andersen@gmail.com</a>> wrote:<br>
>><br>
>> On Tue, Jul 19, 2011 at 03:27, Tristan Sloughter<br>
>> <<a href="mailto:tristan.sloughter@gmail.com" target="_blank">tristan.sloughter@gmail.com</a>> wrote:<br>
>><br>
>> > Can anyone think of a way I can keep the nice URLs and serve the static<br>
>> > html<br>
>> > files through nginx or another webserver.<br>
>><br>
>> Put a Varnish accelerator in front of your system<br>
>> (<a href="https://www.varnish-cache.org/" target="_blank">https://www.varnish-cache.org/</a>). That way, it doesn't matter if your<br>
>> backend is slow at serving files as the accelerator will just cache<br>
>> static stuff for you. In addition, you avoid the trouble of going<br>
>> through another system as a proxy for static content. Also, the<br>
>> solution is quite modular. On the development system, you don't need<br>
>> more than a single system running Erlang.<br>
>><br>
>> In my opinion, there is little reason not to plug into the whole<br>
>> industry there is where the main point is to make serving HTTP go<br>
>> faster. Trying to beat that with Erlang is probably possible, but I<br>
>> don't think it is beneficial. Varnish is really really hard to beat.<br>
>> It is built specifically for being insanely fast and it serves its<br>
>> data from a shared mmap()'ing, scales to multiple CPUs and is a big<br>
>> blob of nasty C code. I'd rather stand on the shoulders here than<br>
>> trying to mess with it myself.<br>
>><br>
>><br>
>> --<br>
>> J.<br>
><br>
><br>
</div></div><div><div></div><div>> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>