Welcome! Log In Create A New Profile

Advanced

static file server recursively redirect to index.html

Posted by 787810465 
static file server recursively redirect to index.html
May 22, 2018 03:27AM
nginx version: nginx/1.0.15

I have configed a static file server.
conf:

location /strategy/ {
root /www;
}

under the directory /www/strategy, there is a file named date.txt. which content is:
Tue May 22 11:23:47 CST 2018

I can get the right response with curl:

curl http://localhost/strategy/date.txt

but when i visit the URL(http://localhost/strategy/date.txt) in chrome, it was redirected to http://localhost/strategy/date.txt/
and then to http://localhost/strategy/date.txt/index.html,
then http://localhost/strategy/date.txt/index.html,
then http://localhost/strategy/date.txt/index.html/index.html,
then http://localhost/strategy/date.txt/index.html/index.html/index.html,
...
and so on.

Can anybody explain why? Thanks in advance!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 154
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