У меня есть такая структура URL:
И хочу переписать это на:
Для этого я попробовал около 1000 комбинаций, которые в основном сводятся к следующему коду:
location /overview/ {
rewrite ^/overview/(.+)$ /triggers/overview.php?technician=$1 last;
}
Я использую Ajenti, php-fpm 7 & nginx.
Есть идеи?
Также здесь весь .conf-файл для контекста:
server {
listen *:80;
listen *:443 ssl;
ssl_certificate /certificates/fullchain.pem;
ssl_certificate_key /certificates/privkey.pem;
server_name subdomain.domain.com;
access_log /var/log/nginx/technicians.access.log;
error_log /var/log/nginx/technicians.error.log;
root /srv/technicians;
index index.html index.htm index.php;
# ACME challenge for letsencrypt
location ^~ /.well-known/acme-challenge {
alias /var/www/letsencrypt.sh;
}
# rewrite overview
rewrite_log on;
location /overview/ {
rewrite ^/overview/(.+)$ /triggers/overview.php?technician=$1 last;
}
# rewrite urls of requirements
rewrite ^/requirements/(.*)$ /requirements/$1.html last;
location ~ [^/]\.php(/|$) {
fastcgi_index index.php;
include fcgi.conf;
fastcgi_pass unix:/var/run/ajenti-v-php7.0-fcgi-technicians-php7.0-fcgi-0.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}