Hosting the Privacy Center at a Subfolder of Your Site
By default Ethyca's privacy center comes with a subdomain (e.g. yourbrand.ethyca.com) and a custom domain (e.g. privacy.yourbrand.com). They're great for SEO by default (Google's pretty good at working out which content's yours now!) and for most customers there's no need to change things.
There's some cases where it's desirable to integrate your Privacy Center more into your site.
If you need to it's possible to host your Ethyca Privacy Center at a subfolder of your own domain and there's a couple ways to do that.
Please note: For any of these configurations, you still need to setup your custom subdomain, while this won't be shown to your user, it's needed to ensure we can correctly write cookies to your domain to manage your users preferences.
Two Options to hosting at a Subfolder
- Embedding with an iFrame
- Advanced: Using Reverse Proxy
Embedding with an iframe
You can easily add an iframe to your Ethyca Privacy subdomain from anywhere on your site. This is a little tricky to make look awesome but we have some customers that've done this super successfully.
<iframe src="https://privacy.yourbrand.com" height="500" width="1000"></iframe>
Advanced: Using a Reverse Proxy
You can also reverse proxy your docs through something like nginx. You'll need set up a listen block to rewrite the URL of your subfolder to your Ethyca subdomain, like this:
location /privacy/ {
resolver 8.8.8.8;
set $proxy_pass_url https://privacy.yourbrand.com;
rewrite ^/privacy/(.*) /$1 break;
proxy_pass $proxy_pass_url;
proxy_ssl_server_name on;
}
Debugging nginx
nginx is an awesome reverse proxy... until it's not. Depending on your setup, you may experience a variety of problems getting this working, especially when you're working with SSL and load balancers. If you're having problems, try experimenting with these options:
Option | Possible Value(s) |
---|---|
proxy_ssl_name | Your Ethyca subdomain host (e.g. yourbrand.ethyca.com), your custom domain host (e.g. privacy.yourbrand.com) |
proxy_set_header | $host, your Ethyca subdomain host (e.g. privacy.yourbrand.com) |
Support
Please contact [email protected] if you require any technical assistance.
Updated about 2 years ago