#4204 - Issues getting the Reverse Proxy script to work
Hi team.
I am Lorraine's network engineer - Clayton Lee posting on Lorraine's behalf.
We have our SugarCRM instance behind a firewall with no public access. As such we are trying to implement the reverse proxy script described on the support site .
I have brought up a fresh Ubuntu install with Apache, PHP and cURL. I ran up a simple PHP page with a cURL script and everything appeared to work fine.
I then uploaded the reverseproxy script as webhook.php, populated a test Mailchimp list with that webhook and sent out a mail shot.
Given I am not a Linux or PHP expert I am only able to do rudimentary troubleshooting. I can see in the Apache logs that Mailchimp initially validated the Webhook page and then was hitting the page when I changed my profile in he email campaign link :![Tail Log.png](https://www.sugaroutfitters.com/assets/img/support/SugarChimp/725c97eb25f917b5293bc3d804d1dadb/Tail%20Log.png "Tail Log.png")
I left the traffic unencrypted over port 80 for now so I could sniff the traffic and see what was going on I ran a packet capture on the Reverse Proxy sever and I can see the post information is coming through correctly:
![Webhook Packet Capture.png](https://www.sugaroutfitters.com/assets/img/support/SugarChimp/725c97eb25f917b5293bc3d804d1dadb/Webhook%20Packet%20Capture.png "Webhook Packet Capture.png")
But I don't see any corresponding traffic leaving the Reverse Proxy server and sending the http request onto the SugarCRM server:
![Packet List.png](https://www.sugaroutfitters.com/assets/img/support/SugarChimp/725c97eb25f917b5293bc3d804d1dadb/Packet%20List.png "Packet List.png")
The IP redacted with the black bars is all the same IP - that of the Reverse Proxy server - it never sends a packet to try to initiate comms with the SugarCRM server.
I have copied the PHP file straight into webhook.php:
![Webhook.php.png](https://www.sugaroutfitters.com/assets/img/support/SugarChimp/725c97eb25f917b5293bc3d804d1dadb/Webhook.php.png "Webhook.php.png")
And I have confirmed that the redacted hostname in webhook.php is resolvable in DNS by the Reverse Proxy Server and have issued curl -k https://crm.xxxxxxxxxx.com/index.php to check that I am not getting blocked by a firewall or anything else and get the expected response of being told to enable Javascript to access Sugar 7.
I expect my problem is with the PHP file - but I am not a PHP coder and don't know where to start. Is there any easy way I can have it log what it is doing to a log file or somesuch so I can work out why it is not firing onwards to my Sugar server?
Thanks
Clayton
5 years ago
Hello Clayton,
Thank you for debugging so thoroughly. I believe the issue is that your initial webhook url set in Mailchimp does not contain the necessary request parameters to allow us to move the data to your instance. can you append the url with "?module=SugarChimp&entryPoint=SugarChimpWebhook"
That should let the code enter into the big "if" statement and then send the curl request. Let me know if that does not get it for you. I'd be glad to hop on a brief call if you are still having issues. As you said, It looks like everything is setup correctly based on your manual curl requests and responses.
Kind Regards, Jon
5 years ago
Jon Thanks so much for the quick reply! You were right - I can see now why the PHP wasn't firing.
I know it is an edge case and the support page for it probably doesn't get many hits - but you might want to update https://fanaticallabs.zendesk.com/hc/en-us/articles/360022146071-Setting-Up-a-Reverse-Proxy to indicate that the webhook has to include the string in the URL to get through the IF statement.
It is probably crystal clear to someone who can write PHP well - but I totally missed that.
The data is now flowing correctly into Sugar - that is great.
Unfortunately it looks like I might be working at crossed purposes - I just sat down with Lorraine and it appears that the data she is not getting into SugarCRM is the Open/Click Link data from Mailchimp. All is not lost, because now we get the profile change and unsubscribe info as well - but I will open another ticket regarding her specific issue - hopefully it is an easy fix.
Thanks again for the prompt reply.
5 years ago
Hi Clayton,
Thanks for those thoughts! Jon went ahead and adjusted that support article to include this information. Thanks for the insight so we can prevent frustration for others.
In regards to the Mailchimp Activity, that data should populate about once every 24 hours after a campaign is sent. Now that you have the reverse proxy up and running, have you tried sending a test campaign?
Thanks, Heidi
5 years ago
Hello there,
We haven't heard from you regarding the issue in a few days. Is there anything we can help with?
Let me know how I can help.
Thanks, Heidi Fanatical Labs Support