Skip to content

Instantly share code, notes, and snippets.

@alfarioekaputra
Last active September 30, 2020 07:16
Show Gist options
  • Save alfarioekaputra/d091d3ab043580dd24df0573c7a0ec11 to your computer and use it in GitHub Desktop.
Save alfarioekaputra/d091d3ab043580dd24df0573c7a0ec11 to your computer and use it in GitHub Desktop.
Nginx configuration for bedrock wordpress
server {
server_name example.com www.example.com;
root /var/www/example.com/web;
index index.php index.htm index.html;
# Prevent PHP scripts from being executed inside the uploads folder.
location ~* /app/uploads/.*.php$ {
deny all;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
include /etc/nginx/fastcgi.conf;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment