Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Dmivlagus

    (@dmivlagus)

    Thank you!

    Thread Starter Dmivlagus

    (@dmivlagus)

    It’s working! Thank you so much! 🙂

    Thread Starter Dmivlagus

    (@dmivlagus)

    I changed this section and did so:

    location ~ .php$ {
      try_files $uri =404;
      include fastcgi_params;
      fastcgi_pass unix:/var/run/php5-fpm.sock;
      fastcgi_cache_bypass $skip_cache;
      fastcgi_no_cache $skip_cache;
      fastcgi_cache WORDPRESS;
      fastcgi_cache_valid 200 301 202 404 60m;
    }

    It does not work.
    When I look at the source code of the page. I see the cached information that displays Nginx-Helper bottom of the page. For example,

    <!--Cached using Nginx-Helper on 2013-10-25 17:19:51. It took 14 queries executed in 0,587 seconds.-->
    <!--Visit http://wordpress.org/extend/plugins/nginx-helper/faq/ for more details-->

    If I refresh the page, the information at the bottom of the page changes.
    For example,
    Cached using Nginx-Helper on 2013-10-25 17:29:54
    Cached using Nginx-Helper on 2013-10-25 17:29:59.
    Cached using Nginx-Helper on 2013-10-25 17:30:04.
    Perhaps the reason for this?

    Thank you for helping me

    Thread Starter Dmivlagus

    (@dmivlagus)

    @rahul286

    Unfortunately, it does not work. If a lot of time to refresh the page 404, php-fpm create are a large load on the server. Screenshoot
    My nginx.conf

    server {
    	listen   80;
    	server_name example.com www.example.com;
    
    	root /home/server/htdocs/example.com/www;
    
    	access_log /home/server/logs/example.com/nginx.access.log;
    	error_log /home/server/logs/example.com/nginx.error.log;
    	index index.php index.html index.htm;
    
    	location ~ \wp-login.php {
    	auth_basic "Unauthorized";
    	auth_basic_user_file /home/server/.htpasswd;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            include fastcgi_params;
            }
    
    	#Block HotLink
    	location ~ \.(jpeg|png|gif|jpg)$ {
    		valid_referers none blocked example.com *.example.com;
    		if ($invalid_referer) {
    		return 403;
    		}
    	}	
    
            #cache static files
       	location ~ ^/(images|javascript|js|css|flash|media|static)/ {
         		root /home/server/htdocs/example.com/www;
          		expires 10d;
        	}
    
    	error_page 404 /404.html;
    	error_page 500 502 503 504 /50x.html;
    	location = /50x.html {
    		root /etc/nginx/error;
    	}
    
    	set $skip_cache 0;
    
    	# POST requests and urls with a query string should always go to PHP
    	if ($request_method = POST) {
    		set $skip_cache 1;
    	}
    	if ($query_string != "") {
    		set $skip_cache 1;
    	}   
    
    	# Don't cache uris containing the following segments
    	if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
    		set $skip_cache 1;
    	}   
    
    	# Don't use the cache for logged in users or recent commenters
    	if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
    		set $skip_cache 1;
    	}
    
    	location ~ .php$ {
    		try_files $uri /index.php;
    		include fastcgi_params;
    		fastcgi_pass unix:/var/run/php5-fpm.sock;
    		fastcgi_cache_bypass $skip_cache;
    	        fastcgi_no_cache $skip_cache;
    
    		fastcgi_cache WORDPRESS;
    		fastcgi_cache_valid  60m;
    	}
    
    	location ~ /purge(/.*) {
    	    fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1";
    	}	
    
    	location / {
    	try_files $uri $uri/ /index.php?$args;
    	}
    	location = /favicon.ico {
    		log_not_found off;
    		access_log off;
    	}
    	location = /robots.txt {
    		allow all;
    		log_not_found off;
    		access_log off;
    	}
    	location ~ /\. {
    		deny all;
    	}
    	location ~* /(?:uploads|files)/.*\.php$ {
    		deny all;
    	}
    
    	rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    
    	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;
    	}
    }

    I checked server headers. They are correct.
    Please tell me what could be the reason?

Viewing 4 replies - 1 through 4 (of 4 total)