I have done research for Ngnix, varnish caching enabled wordpress setup.
Nginx Virtualhost configuration for wordpress.
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;
}
}
Install varnish open file /etc/default/varnish, configure like below.
DAEMON_OPTS="-a :80 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-s malloc,256m"
Check the running port.
netstat -ntulp
if netstat command not found.
sudo apt-get install -y net-tools