I have done research for Ngnix, varnish caching enabled wordpress setup.
wordpress的Nginx Virtualhost配置。
server {
listen 127.0.0.1:8080 default_server;
listen [::]:8080 default_server;
root /var/www/html/wordpress;
index index.php index.html index.htm;
server_name yourdomain.com www.yourdomain.com;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \\.php$ {
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
}
安装varnish open file/etc/default/varnish,如下所示进行配置。
DAEMON_OPTS="-a :80 \\
-T localhost:6082 \\
-f /etc/varnish/default.vcl \\
-S /etc/varnish/secret \\
-s malloc,256m"
检查正在运行的端口。
netstat -ntulp
如果找不到netstat命令。
sudo apt-get install -y net-tools