0 votes
138 views
by Talented
Hi ! We have an issue with a plugin that has a login page (on the url https://ourwebsite.fr/connexion).
Login don't work after a while, because of the Nginx cache. When we do a "full purge" of the cache by the Nginx helper plugin in our wordpress, everything is OK, but the problem is coming back again and again few hours after...
Could you please tell us how to bypass or deactivates the nginx cache for a specific website, and the specific login page : https://ourwebsite.fr/connexion ?

We triend to find how to do, but no luck... So we prefer ask the question to the webinoly specialist :)

Thanks for your help!!

Regards
by Rookie
Hi! If I understand you correctly, did you install the Nginx Helper Wordpress plugin for Webinoly? The fact is that it does not work for my site. In addition, this problem was discussed here and there is still no single solution. Does Nginx Helper work correctly for your site?

2 Answers

0 votes
by Talented
Just to add, we added on the custom rules of our website these lines :

if ($request_uri ~* "/connexion/|/password-recover/|/password-reset/") {         
set $skip_cache 1;
}

if ($http_cookie ~* " comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
set $skip_cache 1;
}

our connexion page is on /connexion/ and others are for lost password and reset.

Could you confirm that it's OK like that on webinoly / nginx ?

Thanks :)
by Expert

Just be careful of not having duplicate Nginx rules, check: /etc/nginx/common/wpfc.conf

0 votes
by Talented
Hi,
So we continue to have the login issue on our website with the cache.
We need to do a cache purge (by the webinoly command) each morning, in order to let our users login on the website.
We tried many rules already, to don't cache our login page (that is https://xxxx.com/connexion/), but nothing is working..

We have :
 

if ($request_uri ~* "/connexion/|/password-recover/|/password-reset/") {

set $skip_cache 1;

set $skip_reason "${skip_reason}-URI";

}

location ~ \.php$ {

        try_files $uri =404;

        # add cache status

        add_header WP-Bullet-Fastcgi-Cache $upstream_cache_status;

        # add the cache skip reason if relevant

        add_header WP-Bullet-Skip $skip_reason;

        include fastcgi_params;

        fastcgi_pass unix:/run/php/php7.3-fpm.sock;

        fastcgi_split_path_info ^(.+\.php)(.*)$;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        fastcgi_cache_bypass $http_secret_header $skip_cache;

        fastcgi_no_cache $skip_cache;

        fastcgi_cache WORDPRESS;

        fastcgi_cache_valid 404      1m;

        fastcgi_cache_valid  60m;

}
by Expert
Did you see the file I mentioned in my previous comment?
The solution for your problem is there.
Welcome to the Community site for Webinoly.

Our Optimized LEMP Web Server is a powerful set of commands for doing just about anything you could wish.

With Webinoly you can set up your NGINX web server in just one step.

* * * * * * *

If you have a question about Webinoly, please ask in English or Spanish.

To report a bug, please ask a question here with the bug tag.

Donations

Webinoly Support Paypal Donations Webinoly Support Bitcoin Donations

Your regular donations is what keep this project moving forward. If you like Webinoly, buy me a coffee or a beer to show support.

Affiliate Links

It is very important that any visitor to the site read the disclaimer, terms of use and privacy and legal statement before start browsing.

...