Does anyone have a working template for Nginx & PHP-FPM?
No Apache on the server.
Thanks in advance.
Ivan
Does anyone have a working template for Nginx & PHP-FPM?
No Apache on the server.
Thanks in advance.
Ivan
server {
listen 8080; # Can be omitted if Nginx runs on Port 80
index index.php index.html;
server_name localhost; # Adjust to your domain setup
root /usr/share/nginx/html; # Adjust to your setup
default_type text/plain;
add_header X-Content-Type-Options nosniff;
rewrite ^/(content|site|kirby)/(.*)$ /error last;
rewrite ^/\.(?!well-known/) /error last;
rewrite ^/(?!app\.webmanifest)[^/]+$ /index.php last;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~* \.php$ {
try_files $uri =404;
fastcgi_pass php:9000; # Adjust to your setup
include fastcgi.conf;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SERVER_PORT 8080; # Only needed if external port is different from the listen port
}
}
Here’s easily from this you can make yourself a template as you need!