nginx-php82-alpine/nginx/conf.d/default.conf

39 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-10-12 11:49:42 +00:00
server {
index index.php index.html index.htm;
listen 80;
listen [::]:80;
root /app;
charset utf-8;
#This is a rewrite rule. It is telling nginx to try to find the file in the root directory. If it can't find it, it will try to find it in the root directory with a trailing slash. If it can't find it there, it will try to find it in the routes.php file.
2024-10-12 11:49:42 +00:00
location / {
try_files $uri $uri/ /routes.php?$query_string;
2024-10-12 11:49:42 +00:00
}
error_page 404 /routes.php;
location routes.php {
}
#This is telling nginx to return a 404 error if it finds a php file.
location ~ \.php {
return 404;
}
location ~ (\.png|\.jpg|\.gif|\.jpeg|\.zip|\.css|\.svg|\.js)$ {
}
location = /routes.php {
try_files $uri /routes.php?$query_string;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
2024-10-12 11:49:42 +00:00
fastcgi_pass 127.0.0.1:9000;
fastcgi_index routes.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
2024-10-12 11:49:42 +00:00
}
2024-10-12 11:49:42 +00:00
server_name bsapi.home.brynstuff.co.uk;
}