Very slow TTFB on a specific page with a wordpress/lemp setup

So I have a LEMP droplet running on an Ubuntu 16.04 which I made using the one-click app feature. I ran various tutorials to get Wordpress up and running with HTTPS and so on, which went fine. The website is generally running quite fast (faster than my previous setup) but I seem to have issues with one specific page. For some odd reason, that specific page takes on average 15sec (14-16s TTFB) before it receives its first byte. I’ve tried Googling the issue but without success. The same page ran normally on the previous setup (a shared hosting).

Screenshot of the inspector

I’m not sure where to pinpoint the problem and I’m desperate for a direction to look for because I have no idea what to search for.

My nginx conf

user www-data;
worker_processes 1;
pid /run/;

events {
	worker_connections 1024;
	# multi_accept on;

http {

	# Basic Settings

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	# server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	# SSL Settings

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
	ssl_prefer_server_ciphers on;

	# Logging Settings

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	# Gzip Settings

	gzip on;
	gzip_disable "msie6";
	# gzip_vary on;
	# gzip_proxied any;
	# gzip_comp_level 2;
	# gzip_buffers 16 8k;
	# gzip_http_version 1.1;
	gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

	# Virtual Host Configs

	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;

And /etc/nginx/sites-available/digitalocean

server {
	listen 80 default_server;
	listen [::]:80 default_server ipv6only=on;
	listen 443 ssl http2; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

	root /var/www/html;
	index index.php index.html index.htm;

	# Make site accessible from http://localhost/

	gzip on;
    gzip_comp_level	5;
    gzip_min_length    256;
    gzip_proxied       any;
    gzip_vary          on;

    # text/html is always compressed by gzip module

    location ~*  \.(jpg|jpeg|png|gif|ico|css|js|pdf)$ {
        expires 7d;

	location = /favicon.ico { log_not_found off; access_log off; }
	location = /robots.txt { log_not_found off; access_log off; allow all; }

	location = /wp-config.php {
        deny all;

    # no access to php files inside an uploads or files folder
    location ~* /(?:uploads|files)/.*\.php$ {
            deny all;

    # no access to root folder, .htaccess, or .svn files or folders
    location ~ /\.(ht|svn)? {
            deny all;

	if (!-e $request_filename) {
		rewrite ^.*$ /index.php last;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		#try_files $uri $uri/ =404;
		try_files $uri $uri/ /index.php?q=$uri&$args; 
		# Uncomment to enable naxsi on this location
		# include /etc/nginx/naxsi.rules

	error_page 404 /404.html;
	error_page 500 502 503 504 /50x.html;
	location = /50x.html {
		root /usr/share/nginx/html;

	location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;

	location ~ /\. { deny  all; access_log off; log_not_found off; }

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

i have the same issue and compared it to the same content on LAMP setup(wordpress clean setup with astra and import one their free starter sites), the one on lamp is much faster !!!

other than that there is also a warning on test results on for Compress Transfer, and not for the one on lamp

DId you find a fix for this? Having the same issue…