Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Woocommerce webhook debugging on nginx in a docker container

I just moved a woocommerce shop from a normal shared hosting to a setup with docker containers and docker-compose. Actually it is running on nginx and it works fine so far. The only thing which stopped working are the webhooks.

If I go to the webhooks settings and configure e.g. order complete hook and save this settings the URL gets called without any problem and I can see the test call from the webhook save. But when I actually complete an order (yes I also tried it with lot of other hooks) just nothing happens. I have debugging and error logging to true and I still can't see any errors. Also in the server error logs are no errors.

Do I need some special settings or services for webhooks to work properly with nginx? Do you have a quick idea how I can debug this issue here, if I get no errors with debug true and error log all? Or maybe are there any issues regarding file permissions? (already set 644 and 755 properly)

Specs:

  • Wordpress 4.6.1
  • Woocommerce 2.6.4
  • nginx 1.11.4
  • PHP 7.0.11
  • cUrl 7.38.0, OpenSSL/1.0.1t
  • MySql 5.7.15
  • Docker 1.12.1
  • Docker Compose 1.8.0
like image 366
Lucas Jahn Avatar asked Jan 26 '26 10:01

Lucas Jahn


1 Answers

Is your try_files section of your Nginx config stripping query strings from index.php? The cart requires query strings.

If you have a line like:

location / {
  try_files $uri $uri/ /index.php;
}

Try:

location / {
  try_files $uri $uri/ /index.php?$args;
}

Restart Nginx after a change like that.

And, to dump all actions and filters, check out https://gist.github.com/studiograsshopper/1273784

Use this is the theme's functions.php file.

add_action( 'all', create_function( '', 'var_dump( current_filter() );' ) );
like image 63
markratledge Avatar answered Jan 28 '26 03:01

markratledge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!