Support

Home Forums Event Espresso Premium Clicking register now does nothing nginx varnish caching

Clicking register now does nothing nginx varnish caching

Posted: August 13, 2014 at 8:52 pm


David Hudson

August 13, 2014 at 8:52 pm

Site is at http://jccdev.org/events/test2/

When you select a quantity and click register now, the user is directed back to the same page without ever hitting the checkout page.

I recently moved EE4 to a new host with the same domain. The new host is using nginx and varnish. I have tried bypassing varnish by setting the site url to the internal port number. I am not using nginx’s proxy_cache, and nginx should respect the EE4 headers. Also, I have completely wiped EE4 data using the link in maintenance and reinstalled EE4.

Any ideas? Thanks!


Tony

  • Support Staff

August 14, 2014 at 4:12 am

Hi David,

Although you say you moved sites with the same domain when you select tickets the domain changes from jccdev.org/events/test2/ to jewelcitychurch.org/events/test2/

Are you currently running two sites? Live and development for example?

It depends on the setup and how the site was moved/migrated, but it appears as though the site was moved incorrectly.


David Hudson

August 14, 2014 at 2:53 pm

I posted the wrong link here. I had the whole site running at jccdev.org before I switched the A records to move real traffic over. The site is typically accessed at jewelcitychurch.org.

I should also mention that WordPress is at 3.9.2 and 4.3.0.p for EE.


Lorenzo Orlando Caum

  • Support Staff

August 14, 2014 at 3:30 pm

Hi David,

So we should be looking at the following site?

http://jewelcitychurch.org/events/test2/

Are caching services also off on the domain above?


Lorenzo


David Hudson

August 14, 2014 at 8:00 pm

There are no plug-ins that do caching such as W3TC on that domain. Varnish does cache, but I tried turning that off completely (rather, bypassing it by using the inside port) to no avail.


Darla Maier

August 14, 2014 at 8:29 pm

I’m experiencing the same issue at: http://www.pacificperinatalgroup.com/events/ppg-presents-perinatal-topics/ During development everything worked and tested fine but I was using the default permalinks. I turned the site live and updated permalinks to use the post name.

My setup is more straight forward: WordPress LAMP EE4 no caching server


Tony

  • Support Staff

August 15, 2014 at 5:05 am

@Darla,

I’ve just ran a test registration on your event without any issue, do you still have the same issue when you try registering?

@david,

When creating this event did you give it a title before publishing?


David Hudson

August 15, 2014 at 5:36 am

It was titled before publishing. The link that I posted is a test event. There is one real event located at http://jewelcitychurch.org:8080/events/vine-worship-conference/

I tested @Darla’s link last night and it did not work, but it does direct me to registration today.


Dean

August 15, 2014 at 5:51 am

Hi David,

http://jewelcitychurch.org:8080/events/vine-worship-conference/ returns a 404 error.

@Darla, I also checked your site and the registration button works correctly.


David Hudson

August 15, 2014 at 6:27 am

Sorry about that 404. I forgot that I changed the permalink as part of troubleshooting. The port 8080 is also a troubleshooting step where I eliminated the front-end Varnish proxy to no avail. New link here:

http://jewelcitychurch.org:8080/events/vine-conference/


Tony

  • Support Staff

August 15, 2014 at 7:12 am

It’s a strange issue.

First I would make a Full Site Back-up

Then in this case I would try a full troubleshoot. Try switching the theme to one of the default theme (twentyfourteen) for example and retesting the page. (You can do this without effecting the live view using a plugin such as Theme Test Drive)

If the page still does not work, try temporarily disabling all non ee plugins and retest. If it then works activated each plugin one by one and retest between each one. When the page then stops loading we’ll know which plugin is causing a conflict.


David Hudson

August 15, 2014 at 9:34 am

I just tried the twentyfourteen theme with only Theme Test Drive and EE plugins activated, but the same behavior persists.


Tony

  • Support Staff

August 15, 2014 at 11:27 am

I suspect this is being caused by Varnish, could you try installing a plugin such as Varnish HTTP Purge, purge the cache and see if you can run at least one registration?

If it is Varnish then the issue will come back once the page caches again.


David Hudson

August 15, 2014 at 11:45 am

I tried the plugin as you suggested and it did not work. When you access the site at port 8080, you bypass the Varnish proxy. I have changed the site url to default to port 8080, so I don’t believe that Varnish should be in the stack anymore.


Tony

  • Support Staff

August 15, 2014 at 12:01 pm

Can I ask who your current host is please?


David Hudson

August 15, 2014 at 12:01 pm

The site is on a VPS hosted by RamNode.


Tony

  • Support Staff

August 15, 2014 at 12:18 pm

The only cause we can see for this caching.

I asked one of our developers to take a closer look at that page, this is what he replied with:

that site is probably having some kind of caching issue… when you submit that form, it’s passing a POST var called noheader, which tells WP not to send headers… so the fact that a full html page is coming back, means that that request is NOT making it through… so their caching is probably ignoring the request vars
ie: http://jewelcitychurch.org:8080/events/test2/?ee=process_ticket_sel
is retuirning http://jewelcitychurch.org:8080/events/test2/

It is also possible that the :8080 redirect is not being used by the redirect, and is returning a cached result.

When caching, Event Espresso critical pages usually need to be set to be excluded from any and all caching as they are dynamically created for each user. We recently had a request from another site using Varnish that refused to work so I believe this to be the cause.

You could try contacting your host and see if they can explicitly exclude EE4’s critical pages from caching.


David Hudson

August 15, 2014 at 7:29 pm

I was able to fix it. Caching was not causing the no action on register issue. The main try_files redirect in nginx’s site config was to blame. I changed it to the below per the codex:

try_files $uri $uri/ /index.php?$args;

Caching (Varnish) did cause an issue after that on checkout. I added the following to default.vcl’s vcl_recv section to exclude EE’s critical pages:

if(req.url ~ "^/events/." ||
req.url ~ "^/registration-checkout/." ||
req.url ~ "^/transactions/." ||
req.url ~ "^/thank-you/." ||
req.url ~ "^/registration-cancelled/." ) {
return (pass);
}

Thanks for the help!


Lorenzo Orlando Caum

  • Support Staff

August 15, 2014 at 8:29 pm

Thanks for sharing the solution. This will be very helpful to other members interested in running Nginx and Varnish caching.


Lorenzo

The support post ‘Clicking register now does nothing nginx varnish caching’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso