Я использую следующую перезапись в sites-available / default
location / {
rewrite ^/[^.]+/[^.]+/([^-]*).html$ /release.php?id=$1 break;
}
domain.com/release.php?id=abc123 работает корректно
domain.com/the-artist/title-title/123456.html пытается загрузить HTML-файл с именем 123456.html (и включает правильный исходный код)
Как я могу отобразить HTML вместо загрузки?






Возможно, вам стоит использовать last, отличный от break
last stops processing the current set of ngx_http_rewrite_module directives and starts a search for a new location matching the changed URI;
break stops processing the current set of ngx_http_rewrite_module directives as with the break directive;
Возможный дубликат Как настроить nginx для обслуживания HTML-файлов для просмотра вместо загрузки?