Quantcast
Channel: Nginx Forum - Nginx Mailing List - Russian
Viewing all articles
Browse latest Browse all 3102

nginx BUG ? unexpected redirect from https://example.com/download to https://example.com/download/ (1 reply)

$
0
0
Здравствуйте!

Есть такой конфиг:

location /download {
proxy_pass http://unix:/run/gunicorn.sock;
}

location /download/ {
alias /home/www/download/;
charset utf-8;
autoindex on;
autoindex_localtime on;
}

при этом nginx почему-то и зачем-то делает самовольный редирект
с https://example.com/download на https://example.com/download/

$ curl -i https://example.com/download

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Tue, 14 Dec 2021 21:16:24 GMT
Content-Type: text/html
Content-Length: 162
Location: https://example.com/download/
Connection: keep-alive

<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

Это баг в nginx ? Можно ли его исправить?

Добавление модификатора = также не помогает:

location = /download {
proxy_pass http://unix:/run/gunicorn.sock;
}

по прежнему происходит 301 редирект на страницу /download/

Если в конфиге поменять proxy_pass

location /download {
#proxy_pass http://unix:/run/gunicorn.sock;
proxy_pass http://127.0.0.1:5000;
}

тогда редиректа не происходит и запрос корректно передается на backend.

Но нужно чтобы все нормально работало именно с сокетом gunicorn.sock

--
Best regards,
Gena
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Viewing all articles
Browse latest Browse all 3102

Latest Images

Trending Articles



Latest Images

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