File: //etc/nginx/sites-enabled/rectt-csmcri.res-in
server {
listen 80;
server_name rectt.csmcri.res.in;
access_log /srv/www/rectt-csmcri.res.in-logs/access.log;
error_log /srv/www/rectt-csmcri.res.in-logs/error.log;
root /srv/www/rectt-csmcri.res.in/public_html;
index login.php;
#— Disable directory listings everywhere
autoindex off;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
#— BLOCK ALL direct access to /sites, #/js, and /css
location ~ ^/(sites|css)/ {
# Option A: completely deny
deny all;
# Option B: restrict by IP instead:
# allow 192.168.1.0/24;
# deny all;
# Option C: HTTP Basic Auth
# auth_basic "Restricted Content";
# auth_basic_user_file /etc/nginx/.htpasswd;
}
location / {
try_files $uri $uri/ /login.php?$args;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
server {
listen 80;
server_name rectt-admin.csmcri.res.in;
access_log /srv/www/rectt-admin-csmcri.res.in-logs/access.log;
error_log /srv/www/rectt-admin-csmcri.res.in-logs/error.log;
root /srv/www/rectt-csmcri.res.in;
index index.php;
location / {
try_files $uri $uri/ /admin_login.php?$args;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}