There is mention of "hooks" needed to correct for the workings of a Reverse Proxy, but after a long search one doesn't find a clear full example -- particularly for Nginx.

I operate Hypnotoad behind nginx, see Nginx in Mojolicious::Guides::Cookbook (in addition I do proxy_set_header X-Real-IP $remote_addr;, but that's optional). Plus, I had to set the proxy => 1 option in the Mojo::Server::Hypnotoad config, and set the MOJO_REVERSE_PROXY environment variable. (The latter may no longer be necessary, I'm not sure because I worked out this config a while ago and Mojolicious evolves quickly, but it also can't hurt to turn it on. Update: I checked and AFAICT, in Hypnotoad, proxy=>1 sets Mojo::Server's reverse_proxy, but for other servers like morbo, it's the MOJO_REVERSE_PROXY environment variable. That's why I set both.)

Note that for requests that shouldn't be buffered/proxied, like EventSource streams, you additionally need to set the X-Accel-Buffering header: $c->res->headers->add('X-Accel-Buffering','no'); (docs).

However, the issue you describe may have nothing to do with the setup - the first step when things don't load is to look at the browser's development tools and the sever logs, or even a Wireshark trace.


In reply to Re: Mojolicious-Hypnotoad-Nginx - rendering images by haukex
in thread Mojolicious-Hypnotoad-Nginx - rendering images by pdkakoba

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.