I recently moved my site from Apache to Nginx but the Nginx code which the script author shared doesn't work with aaPanel.
Here is the Nginx config, can you please provide me with the working code? for aaPanel? (Rewrite lines)
#SAMPLE NGINX CONF FILE
server {
listen 80;
# MAKE SURE THE DOCUMENT ROOT IS THE /public IN THE FOLDER WHERE THE DOMAIN POINTS TO (required)
root /PATHTODOMAINROOT/public;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
## SAMPLE REWRITE RULE FOR THE SCRIPT (required)
location / {
try_files $uri $uri/ /index.php?$query_string;
}
## 404 ERROR (optional)
error_page 404 /index.php;
## THIS IS JUST A SAMPLE, IT WILL DEPEND ON YOUR SERVER
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}