server
{
root /var/www/html/web;
index index.html index.htm ;
server_name siteadi.com; # managed by Certbot
location /
{
try_files $uri /sitekontrol.php$is_args$args;
}
location /
{
try_files $uri /app.php$is_args$args;
}
location ~ ^/(app_dev|config)\.php(/|$)
{
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
location ~ \.php$
{
return 404;
}
}Bu şekilde istediğinize ulaşabileceksiniz.
server {
root /var/www/html/web;
index index.html index.htm index.nginx-debian.html;
server_name siteadi.com; # managed by Certbot
location / {
try_files $uri /app.php$is_args$args;
}
location ~ ^/(app_dev|config)\.php(/|$) {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
location ~ \.php$ {
return 404;
}
}kullandığım sistem gereği rootu root /var/www/html/web; bu şekilde vermem gerekiyor.
sitekontrol.php dosyası var. buda /var/www/html/site/ içersinde. acaba nasıl nginx de gösterebilirim?
siteadi.com/sitekontrol.php yazıldıgında /var/www/html/site/sitekontrol.php çalışmasını nasıl sağlarım