Здравствуйте. Сейчас столкнулся с непонятной ошибкой.
Тестовый пример: ``` root /var/www; location / { try_files $uri =404; } location /test/ { try_files $uri =404; alias /var/test/; } ``` Проверяю доступность тестового файла через curl: ``` curl --head -k https://example.com/test/example.txt HTTP/2 200 ... ``` Файл доступен. Лог отладки: ``` ... *302 test location: "/" *302 test location: "test/" *302 using configuration "/test/" ... *302 http script var: "/test/example.txt" *302 trying to use file: "example.txt" "/var/test/example.txt" *302 try file uri: "/test/example.txt" ... *302 http filename: "/var/test/example.txt" ... *302 http2 output header: ":status: 200" ... ``` Меняю location `test` на такой вариант: ``` location ~ ^/(test|custom)/ { try_files $uri =404; alias /var/test/; } ``` Теперь файл не доступен. По идее должно работать... Лог отладки: ``` ... *303 test location: "/" *303 test location: ~ "^/(test|custom)/" *303 using configuration "^/(test|custom)/" ... *303 http script copy: "/var/test/" *303 http script var: "/test/example.txt" *303 trying to use file: "/test/example.txt" "/var/test//test/example.txt" *303 trying to use file: "=404" "/var/test/=404" *303 http finalize request: 404, "/test/example.txt?" a:1, c:1 *303 http special response: 404, "/test/example.txt?" ... *303 http2 output header: ":status: 404" ... ``` Так и должно работать? Только вот если убрать параметр `alias /var/test/;`, то `location /test/` и `location ~ ^/(test|custom)/` работают одинаково. -- С уважением, Izorkin mailto:izor...@gmail.com _______________________________________________ nginx-ru mailing list -- nginx-ru@nginx.org To unsubscribe send an email to nginx-ru-le...@nginx.org