why coinbase commerce webhook endpoint url cannot send any event , it always show Failed to establish a connection to the remote server at mydomain.com
My website run on ssl domain and no issue in website code, coinbase cannot make any connection to my route , API Keys are correct ,
what happening ?
here is apache conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
ServerName mydomain.com
DocumentRoot /var/www/html/re/public
<Directory /var/www/html/re/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R,L]
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/re/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
CustomLog ${APACHE_LOG_DIR}/coinbase_webhook.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
# Disable forward proxy functionality
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
# Reverse Proxy Configuration for Coinbase Webhook
ProxyPass /webhook/coinbase http://ipaddress/webhook/coinbase
ProxyPassReverse /webhook/coinbase http://ipaddress/webhook/coinbase
<Location /webhook/coinbase>
Header set Access-Control-Allow-Origin "https://beta.commerce.coinbase.com"
Header set Access-Control-Allow-Methods "POST, GET, OPTIONS"
Header set Access-Control-Allow-Headers "Content-Type"
</Location>
</VirtualHost>
i try to send event from coinbase commerce to my endpoint url https://mydomain.com/webhook/coinbase .
i already hosted my website with mydomain.com and security rules are update for 443 80 ports . I already have webhook/coinbase route for webhook event receving from my website . when i send test webhook event from coinbase commerce , why failed connection?
is it due to apache2 server confguration , here conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
ServerName mydomain.com
DocumentRoot /var/www/html/revo/public
<Directory /var/www/html/revo/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R,L]
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/revo/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
CustomLog ${APACHE_LOG_DIR}/coinbase_webhook.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
# Disable forward proxy functionality
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /webhook/coinbase https://mydomain.com/webhook/coinbase
ProxyPassReverse /webhook/coinbase https://mydomain.com/webhook/coinbase
<Location /webhook/coinbase>
Header set Access-Control-Allow-Origin "https://commerce.coinbase.com"
Header set Access-Control-Allow-Methods "POST, GET, OPTIONS"
Header set Access-Control-Allow-Headers "Content-Type"
</Location>
</VirtualHost>
when i send test event from coinbase to my website using endpoint url https://domain.com/webhook/coinbase , failed connection happen ,
i already made security groups for 443 and 80 ports in AWS EC2 . andalready made route for webhook in my website.
My apache2 conf is as follow
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
ServerName domain.com
DocumentRoot /var/www/html/revo/public
<Directory /var/www/html/revo/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R,L]
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/revo/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
CustomLog ${APACHE_LOG_DIR}/coinbase_webhook.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
# Disable forward proxy functionality
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /webhook/coinbase https://domain.com/webhook/coinbase
ProxyPassReverse /webhook/coinbase https://domain.com/webhook/coinbase
<Location /webhook/coinbase>
Header set Access-Control-Allow-Origin "https://commerce.coinbase.com"
Header set Access-Control-Allow-Methods "POST, GET, OPTIONS"
Header set Access-Control-Allow-Headers "Content-Type"
</Location>
</VirtualHost>
Hey @kyaw, Before sending your webhook data, Coinbase Commerce validates that the connection to your service is secure. For this to work, your server must be correctly configured to support https . Please have a look here Using Webhooks | Coinbase Cloud and try establishing a Webhook connection again.
We hope this helps. We’d be happy to answer any more questions.