Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTM Server-Side Tracking Setup is not working using local VirtualHost with docker #358

Open
sajjadh47 opened this issue May 26, 2023 · 0 comments

Comments

@sajjadh47
Copy link

I am testing the GTM server side installation inside my Windows powered docker. I will explain all the steps I am doing and please do correct me what I am doing wrong.

1: I am creating two domain-subdomain in my WAMP Apache server using below code (which works fine)

<VirtualHost *:80>
	ServerName ssgtm.dev
	RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

<VirtualHost *:80>
	ServerName preview.ssgtm.dev
	RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

2: And these for proxying and SSL

<VirtualHost _default_:443>
    ServerName ssgtm.dev:443

    ProxyPreserveHost On
    ProxyRequests Off

    ProxyPass / http://localhost:8080/
    ProxyPassReverse / http://localhost:8080/

    SSLEngine on
    SSLCertificateFile "C:/ssls/ssgtm.dev.crt"
    SSLCertificateKeyFile "C:/ssls/ssgtm.dev.key"
</VirtualHost>

<VirtualHost _default_:443>
    ServerName preview.ssgtm.dev:443

    ProxyPreserveHost On
    ProxyRequests Off

    ProxyPass / http://localhost:8079/
    ProxyPassReverse / http://localhost:8079/

    SSLEngine on
    SSLCertificateFile "C:/ssls/preview.ssgtm.dev.crt"
    SSLCertificateKeyFile "C:/ssls/preview.ssgtm.dev.key"
</VirtualHost>

And now setting docker container:

https://gist.github.com/sajjadh47/234acc3e23223a7c30cef6acc202b9b4

At this point everthing works fine... I can visit both sites and check the /healthz printing ok...

https://i.stack.imgur.com/9rI8A.png

https://i.stack.imgur.com/ilfNO.png

I have added the domain in GTM settings too.. https://i.stack.imgur.com/Jp7EE.png

When now I go to check the tracking : https://ssgtm.dev/?test=ok amd https://ssgtm.dev/gtm/debug?id=GTM-000000&gtm_auth=000000&gtm_preview=env-3 It prints below error in the debug console :

An exception was thrown while proxying preview request. Make sure the PREVIEW_SERVER_URL is set correctly and the preview server is healthy. Message: connect ECONNREFUSED 127.0.0.1:443
What I am thinking is that the tagging server is not able to connect with the preview server? or it is because of the custom virtual domain in my apache local? Any help would be appreciated. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant