Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

static file server recursively redirect to index.html

$
0
0
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!

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>