2 out of 2 members found this post helpful.
wordpress merge excelent cu nginx si php7.
Ca mecanism de cache, personal folosesc w3 total cache (cu memcached, redis, opcode, care imi e la indemana cand instalez)
Ai destule instructiuni aici: https://codex.wordpress.org/Nginx
Ca bonus, daca te pasioneaza, poti citi si aici: https://www.nginx.com/blog/benefits-...caching-nginx/
Eu folosesc urmatorul config (pe langa instructiunile legate de domeniu, calea fisierelor si php):
(si rog sa fiu si eu corectat daca nu e bine)
Cod:
# This order might seem weird - this is attempted to match last if rules below fail.
location / {
try_files $uri $uri/ /index.php?$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
# Directives to send expires headers and turn off 404 error logging.
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off; log_not_found off; expires max;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
location ~ /\. {
deny all;
}
# Deny access to any files with a .php extension in the uploads directory
# Works in sub-directory installs and also in multisite network
# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
# Zero-day exploit defense.
# http://forum.nginx.org/read.php?2,88845,page=3
# Won't work properly (404 error) if the file is not stored on this server, which is entirely possible with php-fpm/php-fcgi.
# Comment the 'try_files' line out if you set up php-fpm/php-fcgi on another machine. And then cross your fingers that you won't get hacked.
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
client_max_body_size 100m;
PS: din cunostintele mele, NGINX nu exclude Varnish, sunt lucruri diferite.
Ultima modificare făcută de Dan; 8th May 2017 la 18:22.
Trust, but verify.