You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.2 KiB
44 lines
1.2 KiB
server {
|
|
listen {{ nginx_port }} default_server;
|
|
server_name {{ server_hostname }};
|
|
root /srv/wordpress/ ;
|
|
|
|
client_max_body_size 64M;
|
|
|
|
# Deny access to any files with a .php extension in the uploads directory
|
|
location ~* /(?:uploads|files)/.*\.php$ {
|
|
deny all;
|
|
}
|
|
|
|
location ~ /\. {
|
|
access_log off; log_not_found off; deny all;
|
|
}
|
|
|
|
location ~ ~$ {
|
|
access_log off; log_not_found off; deny all;
|
|
}
|
|
|
|
location ~ /\.ht {
|
|
deny all;
|
|
}
|
|
|
|
location / {
|
|
index index.php index.html index.htm;
|
|
try_files $uri $uri/ /index.php?$args;
|
|
}
|
|
|
|
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html|woff|woff2|svg|js)$ {
|
|
expires max;
|
|
access_log off;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
try_files $uri =404;
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
fastcgi_index index.php;
|
|
fastcgi_pass unix:/var/run/php-fpm/wordpress.sock;
|
|
fastcgi_param SCRIPT_FILENAME
|
|
$document_root$fastcgi_script_name;
|
|
include fastcgi_params;
|
|
}
|
|
}
|
|
|