Welcome! Log In Create A New Profile

Advanced

Re: Location Alias not working

Francis Daly
August 27, 2016 06:54PM
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 http://127.0.0.1:8080/foo/a

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

curl -v -H Host:x1 http://127.0.0.1:8080/foo/b

gives a 404, error.log says

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

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

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Location Alias not working

İhsan Doğan August 27, 2016 04:40AM

Re: Location Alias not working

Francis Daly August 27, 2016 04:52PM

Re: Location Alias not working

Andrew Holway August 27, 2016 05:20PM

Re: Location Alias not working

Francis Daly August 27, 2016 06:54PM

Re: Location Alias not working

İhsan Doğan August 28, 2016 01:02PM

Re: Location Alias not working

Edho Arief August 28, 2016 01:50PM

Re: Location Alias not working

Francis Daly August 28, 2016 07:20PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 147
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready