URL redirection 421 Misdirected Request Error

Hi There,
I want to redirect a url.readthedocs.io URL to another URL which is managed by us. like domainnew.org.
To do this redirection, I am using our nginx reverse proxy server, any request sent to domainnew.org should be redirected to service.readthedocs.io URL but I am getting 421 Misdirected Request Error with cloudflare banner below.
I wonder if this redirection is possible and is there any limitations that cloudflare blocks any redirected traffic.

Bests.

OK, that is http://url.readthedocs.io => http://domainnew.org

Eh, now we’re talking http://domainnew.org => https://service.readthedocs.io

… which is the exact opposite of what you said earlier.

So what exactly is the end result you’re after?

Note that if your goal is to serve your RTD documentation site from your own (sub)domain, all you have to do is implement their custom domain feature as explained in their documentation below. No need for redirections of any sort.

Hi Georg,
Thank you for the response.

Redirection is https://domainnew.org => https://service.readthedocs.io

My goal is to serve our RTD documentation site from our own (sub)domain
I forwarded the exact documentation to RTD maintainers, but the response I get was that I have to fix the issue.:slight_smile:

Normally proxy_pass is the option to redirect the traffic, but this didn’t work for readthedocs.io domains.

I know this is the dirtiest way to to it, but anyone who stuck with nginx redirection, can do this with return option.


server {
   listen 443 ssl http2;
   server_name /domainnew.org;
   return 301 https://service.readthedocs.io/en/latest$request_uri;

Bests.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.