WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Social Login
Varnish and WSL anyone? (4 posts)

  1. Martin
    Member
    Posted 11 months ago #

    I get a 'You cannot access this page directly.' directly after connecting with a Social Network.

    From what I can gather, it has to do with running the Varnish proxy.

    Has anyone been able to use this plugin and Varnish?
    Any clues in what needs to change for it to work?

    Any help really would be appreciated.
    Martin

    http://wordpress.org/plugins/wordpress-social-login/

  2. Boris Kuzmanovic
    Member
    Posted 10 months ago #

    Ran into this myself today. Here's a fix that works.

    The default.vcl script is most likely removing cookies needed for social login to work. Skip caching of anything passed to a URL that starts with
    /wp-content/plugins/wordpress-social-login/hybridauth/?

    Here's what I have:

    sub vcl_recv {
        # lines skipped here
    
        # Do not cache these paths
        if (req.url ~ "^/wp-cron\.php$" ||
            req.url ~ "^/xmlrpc\.php$" ||
            req.url ~ "^/wp-admin/.*$" ||
            req.url ~ "^/wp-includes/.*$" ||
            # Allow WP Social login to bypass Varnish cache
            req.url ~ "^/wp-content/plugins/wordpress-social-login/hybridauth/\?" ||
            req.url ~ "\?s=") {
                return (pass);
        }
    
        # Define the default grace period to serve cached content
        set req.grace = 6h;
    
        # By ignoring any other cookies, it is now ok to get a page
        unset req.http.Cookie;
        return (lookup);
    }

    Hope it helps.

  3. Martin
    Member
    Posted 10 months ago #

    Thanks for the reply, Boris.
    As it turns out, I ditched Varnish and went with Nginx, memcached, php-fpm 5.5 and W3total Cache, for my situation and sites. A lot less issues and lots faster for my sites.
    Thanks again though and hope it helps someone else

  4. Jon Scaife
    Member
    Posted 9 months ago #

    My varnish config was stripping cookies so i had to make another mod in addition to this one.
    in the vcl_hash section I had to include the following
    hash_data(req.http.Cookie);

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.