Basically I have hidden my server behind cloudflare. My server listens on port 80 and port 25461, and cloudflare only protects on certain ports, 80 being one of them.

But I have a lot of users, having access only to the old port, on their own ddns, to my original ip.

I can have them edit their dynamic dns to point at my new cloudflare domain, but their devices still use the old port.

I was thinking of setting up a man in the middle server, which forwards all queries to the URL, to the port 80 of my new server.

Ideally noip could just take the old incoming port, and forward to port 80. But it doesn't have this option.

So I want:

friends-url.ddns.net:24561 -> mycloudflare-server.com:80

  • 3
    I think reached to a milestone in your life. You should start to use capital letters. – peterh Aug 28 '17 at 0:44
  • I tried to reformulate your question, to make it better comprehensible. How does it look? I hope, I didn't change the meaning. Sometimes, particularly in the last, complex sentences, I am not sure that I didn't change your intent. – peterh Aug 28 '17 at 0:49

Configure your web server to return HTTP 301 Moved Permanently response with redirection to your new URL.

If you are running Apache, you can use <VirtualHost> directive in following way:

<VirtualHost *:25461>
  ServerName example.com
  Redirect 301 / http://mycloudflare-server.com:80

Similarly with NGINX:

server {
       listen         25461;
       server_name    example.com;
       return         301 http://mycloudflare-server.com:80$request_uri;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.