Files
wordpress-skeleton/nginx/wordpress
2025-10-09 22:35:37 -07:00

27 lines
626 B
Plaintext

server {
listen 80;
server_name example.com;
root /var/www/example.com/web;
index index.php index.htm index.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock; # Adjust PHP version as needed
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Prevent PHP scripts from being executed inside the uploads folder.
location ~* /app/uploads/.*.php$ {
deny all;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
}