News for hackers. Stuff that matters.
Re:Nginx: a caching, thumbnailing, reverse proxying image se... by reipahb on Thursday February 18, 2016 @04:19PM (#11129405)
The difference is that the last one also matches requests to "/", while the regex ensures that there is at least a single character after the "/".

That allows "/" to be used for other purposes, e.g. redirecting to the main page of the site, or displaying a nice error page. (However, in this case it simply shows the default Debian Nginx installation page: http://m.charlesleifer.com/ )

Re:Nginx: a caching, thumbnailing, reverse proxying image se... by merlincorey on Thursday February 18, 2016 @04:36PM (#11129521)
For that use case, I would recommend two locations like so:

    location = / {
      # Just whatever happens for "/" requests goes here
    }
    
    location / {
      # Every other requests ends up here
    }
Re:Nginx: a caching, thumbnailing, reverse proxying image se... by obelisk_ on Thursday February 18, 2016 @07:40PM (#11130625)
Actually, Nginx are way ahead of you. Here's the way to handle that.

    location = / { [ configuration A ] }

    location / { [ configuration B ] }
To learn more about this, I recommend http://nginx.org/en/docs/http/ngx_http_core_module.html

The Nginx docs are not always great but they are far more correct than most blog posts about Nginx so that is why I have turned to use only the official docs when I have a question about how to do something with Nginx.