-
-
Save ivanionut/40a130ab800eb4f755b6a40977547c08 to your computer and use it in GitHub Desktop.
Google Analytics Proxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 443 http2 ssl; | |
server_name analytics.example.com; | |
location /ga_proxy { | |
proxy_set_header X-real-ip $remote_addr; | |
rewrite ^/ga_proxy/(.*)$ /$1?$args&uip=$remote_addr; | |
proxy_pass http://www.google-analytics.com; | |
break; | |
} | |
location /analytics.js { | |
proxy_set_header X-real-ip $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Referer https://www.google-analytics.com; | |
proxy_set_header Host www.google-analytics.com; | |
proxy_pass https://www.google-analytics.com; | |
proxy_set_header Accept-Encoding ""; subs_filter_types text/css text/xml text/javascript; | |
subs_filter www.google-analytics.com analytics.example.com/ga_proxy; | |
} | |
} |
Author
ivanionut
commented
May 18, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment