Skip to content

Commit ae9a6d3

Browse files
authored
Merge pull request #4425 from rtfd/davidfischer/alternate-domains-docs-update
Update alt domains docs with SSL
2 parents 6f02839 + f233d4f commit ae9a6d3

File tree

1 file changed

+46
-13
lines changed

1 file changed

+46
-13
lines changed

docs/alternate_domains.rst

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Read the Docs supports a number of custom domains for your convenience. Shorter
66
Subdomain Support
77
------------------
88

9-
Every project has a subdomain that is available to serve its documentation. If you go to <slug>.readthedocs.io, it should show you the latest version of documentation. A good example is http://pip.readthedocs.io
9+
Every project has a subdomain that is available to serve its documentation. If you go to <slug>.readthedocs.io, it should show you the latest version of documentation. A good example is https://pip.readthedocs.io
1010

1111
.. note:: If you have an old project that has an underscore (_) in the name, it will use a subdomain with a hyphen (-).
1212
`RFC 1035 <http://tools.ietf.org/html/rfc1035>`_ has more information on valid subdomains.
@@ -23,7 +23,7 @@ This requires two steps:
2323
.. note:: The ``Domain`` that should be used is the actual subdomain that you want your docs served on.
2424
Generally it will be `docs.projectname.org`.
2525

26-
Using pip as an example, http://www.pip-installer.org resolves, but is hosted on our infrastructure.
26+
Using pip as an example, https://pip.pypa.io resolves, but is hosted on our infrastructure.
2727

2828
As another example, fabric's dig record looks like this::
2929

@@ -32,22 +32,55 @@ As another example, fabric's dig record looks like this::
3232
;; ANSWER SECTION:
3333
docs.fabfile.org. 7200 IN CNAME readthedocs.io.
3434

35-
.. note:: We used to map your projects documentation from the subdomain that you pointed your CNAME to.
36-
This wasn't workable at scale,
37-
and now we require you to set the domain you want to resolve on your project.
35+
.. note::
36+
37+
We used to map your projects documentation from the subdomain that you pointed your CNAME to.
38+
This wasn't workable at scale,
39+
and now we require you to set the domain you want to resolve on your project.
40+
3841

3942
CNAME SSL
4043
---------
4144

42-
We don't support SSL for CNAMEs on our side,
43-
but you can enable support if you have your own server.
44-
SSL requires having a secret key,
45-
and if we hosted the key for you,
46-
it would no longer be secret.
45+
By default, when you setup a custom domain to host documentation at Read the Docs,
46+
we will attempt to provision a domain validated SSL certificate for the domain.
47+
This service is generously provided by Cloudflare.
48+
49+
.. note::
50+
51+
Some older setups configured a CNAME record pointing to ``readthedocs.org``
52+
or another variation. While these continue to resolve,
53+
they do not yet allow us to acquire SSL certificates for those domains.
54+
Simply point the CNAME to ``readthedocs.io``.
55+
56+
.. important::
57+
58+
Due to a limitation, a domain cannot be proxied on Cloudflare
59+
to another Cloudflare account that also proxies.
60+
This results in a "CNAME Cross-User Banned" error.
61+
In order to do SSL termination, we must proxy this connection.
62+
If you don't want us to do SSL termination for your domain --
63+
**which means you are responsible for the SSL certificate** --
64+
then set your CNAME to ``cloudflare-to-cloudflare.readthedocs.io``
65+
instead of ``readthedocs.io``.
66+
67+
For more details, see this `previous issue`_.
68+
69+
.. _previous issue: https://github.com/rtfd/readthedocs.org/issues/4395
70+
71+
72+
Proxy SSL
73+
---------
74+
75+
If you would prefer to do your own SSL termination
76+
on a server you own and control,
77+
you can do that although the setup is a bit more complex.
4778

48-
To enable SSL:
79+
Broadly, the steps are:
4980

5081
* Have a server listening on 443 that you control
82+
* Procure an SSL certificate for your domain and provision it
83+
and the private key on your server.
5184
* Add a domain that you wish to point at Read the Docs
5285
* Enable proxying to us, with a custom ``X-RTD-SLUG`` header
5386

@@ -57,7 +90,7 @@ An example nginx configuration for pip would look like:
5790
:emphasize-lines: 9
5891
5992
server {
60-
server_name docs.pip-installer.org;
93+
server_name pip.pypa.io;
6194
location / {
6295
proxy_pass https://pip.readthedocs.io:443;
6396
proxy_set_header Host $http_host;
@@ -73,4 +106,4 @@ An example nginx configuration for pip would look like:
73106
rtfd.org
74107
---------
75108

76-
You can also use `rtfd.io` and `rtfd.org` for short URLs for Read the Docs. For example, http://pip.rtfd.io redirects to its documentation page. Any use of `rtfd.io` or `rtfd.org` will simply be redirected to `readthedocs.io`.
109+
You can also use `rtfd.io` and `rtfd.org` for short URLs for Read the Docs. For example, https://pip.rtfd.io redirects to its documentation page. Any use of `rtfd.io` or `rtfd.org` will simply be redirected to `readthedocs.io`.

0 commit comments

Comments
 (0)