Last active
September 30, 2020 07:16
-
-
Save alfarioekaputra/d091d3ab043580dd24df0573c7a0ec11 to your computer and use it in GitHub Desktop.
Nginx configuration for bedrock wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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