server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name mail.joshstock.in; root /var/www/rainloop; index index.php index.html index.htm; error_page 404 /error-404.html; location = /error-404.html { root /var/www/josh; } location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_split_path_info ^(.+\.php)(/.+)$; try_files $fastcgi_script_name =404; set $path_info $fastcgi_path_info; fastcgi_param PATH_INFO $path_info; fastcgi_index index.php; include fastcgi_params; } location ^~ /data { deny all; } location = /favicon.ico { root /var/www/josh; } location = /static/favicon.png { root /var/www/josh; } }