Location Alias not working

Francis Daly francis at daoine.org
Sat Aug 27 22:52:02 UTC 2016

On Sat, Aug 27, 2016 at 11:18:04PM +0200, Andrew Holway wrote:

Hi there,

> Can you post your full config pls?

  server {
    listen 8080;
    server_name x1;

    location /foo/ {
      alias /var/www/foo/;

curl -v -H Host:x1

gives a 200 with the contents of the file /var/www/foo/a

curl -v -H Host:x1

gives a 404, error.log says

open() "/var/www/foo/b" failed (2: No such file or directory), client:, server: x1, request: "GET /foo/b HTTP/1.1", host: "x1"

(The events{} and surrounding http{} blocks exist in the config too.)

Francis Daly        francis at daoine.org

More information about the nginx mailing list