server { root /var/www/yourdomain.com/html; index index.php index.html index.htm index.nginx-debian.html; server_name yourdomain.com www.yourdomain.com; # set expiration of assets to MAX for caching location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ { expires max; log_not_found off; } error_page 404 /404.php; error_page 403 /403.php; location / { try_files $uri $uri/ /index.php?$args; } location /r { rewrite ^/r/(.*)$ /redirect.php?query=$1; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.4-fpm.sock; } location ~ /\.ht { deny all; } }