below you can see my nginx config
`server {
#include /var/www/dev.zenaffiliate.com/public/forum/.nginx.conf;
charset utf-8;
client_max_body_size 128M;
listen 443 ssl;
ssl_certificate /etc/nginx/cert/cf.crt;
ssl_certificate_key /etc/nginx/cert/cf.key;
server_name dev.zenaffiliate.com;
root /var/www/dev.zenaffiliate.com/public/;
#include /var/www/dev.zenaffiliate.com/public/forum/.nginx.conf;
autoindex on;
index index.php;
if ($request_uri ~* "^(.*/)index\.php$") {
return 301 $1;
}
set $val 0;
if ($request_uri ~ ^([^.\?]*[^/])$ ) {
set $val 2;
}
if ($request_uri ~ "[n][o][v][a][-][v][e][n][d][o][r][/]"){
set $val 1;
}
if ($request_uri ~ "[a][d][m][i][n][/]"){
set $val 1;
}
if ($request_uri ~ "[n][o][v][a][-][a][p][i][/]"){
set $val 1;
}
if ($request_uri ~ "[v][e][n][d][o][r][/]"){
set $val 1;
}
if ($request_uri ~ "[f][o][r][m][-]"){
set $val 1;
}
#add_header X-debug-message $val always;
if ($val ~ 2) {
#return 301 $request_uri/;
}
location ~ ^/admin/.*$ {
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
try_files $uri $uri/ /index.php$is_args$query_string;
}
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
location = /index.php {
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
}
}
location ~ \.php {
include fastcgi_params;
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 900;
fastcgi_send_timeout 900;
}
location ~ /\.(ht|svn|git) {
deny all;
}
sendfile off;
}`