Last active
November 20, 2018 01:42
-
-
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
This file contains 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
# 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> |
This file contains 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
# 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 |
If you need to handle URL redirections from an old help site, check out this related gist https://gist.github.com/thewheat/a45941cbeab21931e00b7d5c16d4b63b
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
nginx details was shared by Martin from Koalect.com π