9952 explained code solutions for 126 technologies

nginxUsing rewrite rules

server {
  rewrite ^/files/(.+)$ /download.php?file=$1 last;
}ctrl + c
server {

virtual server configuration block


define URL rewrite rule


sample regex to match URI for rewrite


resulting URL to rewrite request to ($1 is captured from previous regex)


stop checking next rewrite rules (if there are any) after this one