<div dir="ltr"><div>Sorry, the parent folder, /images/art was uncommented in .gitignore, that's why didn't uploaded into my repo. Problem solved.<br><br></div>Still, is there any method to share static files? Something like expose the public folder into / URL, but without blocking the route?<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-06 14:38 GMT+02:00 Lantos István <span dir="ltr"><<a href="mailto:kerozin.joe@gmail.com" target="_blank">kerozin.joe@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>I have the following server configuration block:<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><b><i>server {<br> # Running port<br> listen 80; # ipv4<br> listen [::]:80; # ipv6<br> server_name localhost;<br> root /var/www/html;<br><br> # Proxying the connections connections<br> location / {<br> proxy_pass <a href="http://app" target="_blank">http://app</a>;<br> proxy_redirect off;<br> proxy_set_header Host $host;<br> proxy_set_header X-Real-IP $remote_addr;<br> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br> proxy_set_header X-Forwarded-Host $server_name;<br> }<br><br> location ~ ^/(fonts/|gallery/|images/|javascripts/|stylesheets/|ajax_info\.txt|apple-touch-icon\.png|browserconfig\.xml|crossdomain\.xml|favicon\.ico|robots\.txt|tile-wide\.png|tile\.png) {<br> root /var/www/html/public;<br> access_log off;<br> expires max;<br> }<br><br> error_page 401 403 404 /404.html;<br> error_page 500 502 503 504 /50x.html;<br>}</i></b><br></blockquote><br></div>I want to server my static files with Nginx to my Node/Express app. I not want to re-factore every single route in my app, that's why i want to server all these static files into / URL path.<br><br></div>The problem is some files cannot be located on the disk, although they existing, for example<b> </b> <b>/images/art/lindon.png</b>.<br><br></div>This is a docker-compose stack and nginx built from source:<br><a href="https://github.com/DJviolin/lantosistvan/blob/be8e49e2302793d37ed3bfdec865f7086e579197/docker/nginx/Dockerfile" target="_blank">https://github.com/DJviolin/lantosistvan/blob/be8e49e2302793d37ed3bfdec865f7086e579197/docker/nginx/Dockerfile</a><br><br></div>The error message that I got for a missing file:<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><b>lantosistvan_nginx | 2016/07/06 14:24:42 [error] 6#6: *3 open() "/var/www/html/public/images/art/lindon.png" failed (2: No such file or directory), client: 10.0.2.2, server: localhost, request: "GET /images/art/lindon.png HTTP/1.1", host: "127.0.0.1", referrer: "<a href="http://127.0.0.1/hu/blog/mariya-balazs" target="_blank">http://127.0.0.1/hu/blog/mariya-balazs</a>"</b><br></blockquote><br></div><div>Is there any better way to server static files for the / URL without blocking<b> location / {}</b>?<br></div><div><br></div>Thank You for your help!<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888">István<br><br></font></span></div>
</blockquote></div><br></div>