I will not lecture you about 'asking questions: the right way', but if you really want an answer - send more information, please. Now to the business. One of my systems have exactly such setup - hypnotoad serving application on localhost:3000, nginx doing reverse proxy. I don't see where is you're problem could be, I will post my configs so you can find the answer yourself just by comparison of yours and mine configs.

Application is located in /usr/local/x/ports/portmgr, so there is /usr/local/x/ports/portmgr/public dir for static files. There is also /usr/local/www/mgmt dir for other static files.

Nginx:

server { listen 80; server_name mgmt.site.local; location / { try_files $uri @proxy; root /usr/local/www/mgmt; add_header 'Access-Control-Allow-Origin' 'http://some.site.local'; } location @proxy { auth_basic "RTK MGMT Site"; auth_basic_user_file /usr/local/x/snmp/passwd; proxy_pass http://localhost:3000; proxy_set_header Host $host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }

With such config when someone request http://mgmt.site.local/image.png, 1) nginx search /usr/local/www/mgmt for image.png, if not found, 2) request goes to http://localhost:3000, 3) hypnotoad look in /usr/local/x/ports/portmgr/public (and other static paths, which you can add in script) for static file image.png, if it's not found, 4) hypnotoad search routes for /image.png, if no route found, then 404 error displayed.

I would also suggest you to point your nginx root to your application public dir, so static files could be served by nginx, not Mojolicious, thus they will be served much faster.

UPDATE: sorry, i've checked (and corrected post) - hypnotoad first look for static file, then look in routes.


In reply to Re: Mojolicious-Hypnotoad-Nginx - rendering images by alexander_lunev
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.