-
Notifications
You must be signed in to change notification settings - Fork 49
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
www.google-analytics.com无法作为合法域名添加 #4
Comments
亲测可行!如果各位是使用docker nginx容器实现的话,要注意ssl证书安装问题,因为一般ssl是安装SLB层,nginx收到流量时是80端(非443)。因此,使用docker nginx容器做转发时,需要对上面的配置中的server做如下的更改: server {
# listen 443 ssl; # 删除这一行
# ssl on; # 删除这一行
} |
请问Dockerfile你是如何配置的?我按照官网的配置,起来之后直接就马上被关掉了。万分感谢。
感谢 |
配置如下: Dockerfile:
nginx.conf:
nginx-ga-proxy.conf:
|
@xianyuxmu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
因为
www.google-analytics.com
域名没有国内备案,无法添加到微信小程序的request合法域名
中。因此需要对原本发送给
www.google-analytics.com
的数据做转发。假设你有一个已备案域名
example.com
,那么可以用一个二级域名ga-proxy.example.com
来接收跟踪数据。具体方法:
tracker.setTrackerServer("https://ga-proxy.example.com")
example.com
的DNS记录,将ga-proxy.example.com
指向你自己的服务器IPnginx
做如下配置ga-proxy.example.com
的ssl证书配置请参考相关资料(这里略过)另外,
www.google-analytics.com
国内有服务器,因此并不需要你的服务器有翻*墙能力就可以转发跟踪数据。The text was updated successfully, but these errors were encountered: