Skip to content

Instantly share code, notes, and snippets.

@thewheat
Last active November 20, 2018 01:42
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thewheat/c20fa1fac53d06babf8d2046aece513c to your computer and use it in GitHub Desktop.
Save thewheat/c20fa1fac53d06babf8d2046aece513c to your computer and use it in GitHub Desktop.
Custom domain implementation for Intercom's Educate Help Center using a reverse proxy. Select appropriate configuration for your setup. Normal instructions on setting up custom domain will SSL detailed here https://developers.intercom.com/docs/set-up-your-custom-domain
# Step 1: set up normal server with HTTPS https://letsencrypt.org/
# Step 2: set up proxy settings as shown below
# Step 3: set custom domain in Intercom Help Center settings
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName your-help-site.custom-domain.com # specify your custom domain here
SSLEngine on
SSLProxyVerify none
SSLProxyEngine on
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
SSLCertificateFile /path/to/your/fullchain.pem
SSLCertificateKeyFile /path/to/your/privkey.pem
ProxyPreserveHost On
ProxyPass / https://custom.intercom.help/
ProxyPassReverse / https://custom.intercom.help/
</VirtualHost>
</IfModule>
# Step 1: set up normal server with HTTPS https://letsencrypt.org/
# Step 2: set up proxy settings as shown below
# Step 3: set custom domain in Intercom Help Center settings
location / {
# using "set" is important as IP addresses of Intercom servers
# changes dynamically. "set" enables nginx to follow dynamic IPs
set $intercom "https://custom.intercom.help:443";
proxy_set_header Host $host;
proxy_pass $intercom;
}
# SSL setup - sample based on letsencrypt
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/your-help-site.custom-domain.com-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/your-help-site.custom-domain.com-0001/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
# force https
if ($scheme != "https") {
return 301 https://$host$request_uri;
} # managed by Certbot
@thewheat
Copy link
Author

thewheat commented Apr 27, 2017

nginx details was shared by Martin from Koalect.com 😄

@thewheat
Copy link
Author

If you need to handle URL redirections from an old help site, check out this related gist https://gist.github.com/thewheat/a45941cbeab21931e00b7d5c16d4b63b

@looneym
Copy link

looneym commented Jul 11, 2017

Cloudfront/Route 53 configuration example

You first need to create a new distribution in Cloudfront as "Web" and add the following details:

Origin Settings
Origin Domain Name: custom.intercom.help
Origin Protocol Policy: HTTP Only

Default Cache Behavior Settings
Viewer Protocol Policy: Redirect HTTP to HTTPS
Allowed HTTP Methods: GET, HEAD, OPTIONS
Forward Headers: All
Query String Forwarding and Caching: Forward all, cache based on all
​
Distribution Settings
Alternate Domain Names (CNAMEs): [Custom domain used in your Educate settings]
SSL Certificate: Your custom SSL Certificate
Custom SSL Client Support: Only Clients that Support Server Name Indication (SNI)
​```
​
After this distribution is created, you can simply add it to Route53. These are the settings you can use:

​```
Name: [Custom domain used in your Help Center settings]
Alias: Yes
Alias Target: [CloudFront Distribution you just created]
​```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment