Question

I have the following in Ubuntu 12.04:

  1. Daemon Python script listening port 3333.
  2. Apache2 configured for domain name and port 80.
  3. Iptables allowed anything.
  4. CloudFlare as a frontend for domain (3333 port connections 100% goes directly to server)

mydomain.com:80 - works great and launch website.

IP:3333 - works great and connects to my daemon.

mydomain.com:3333 - doesn't work.

Why?

Tried to turn off CloudFlare, no result. Because they don't deal with 3333 port: https://support.cloudflare.com/hc/en-us/articles/200169156-Which-ports-will-CloudFlare-work-with-

Was it helpful?

Solution

since :3333 port is bound by Daemon Python script, then that script is responsible for parsing HTTP headers, you should look into that script and find why the hostname in header causes the problem. Might be the domain hostname is not resolvable to IP internally, or resolves to incorrect IP, f.e. by rules in /etc/hosts

OTHER TIPS

if you pass your domain through cloudflare by clicking cloud-image, your port will be only available like this :

For requests made via HTTP (all domains on CloudFlare):

80 8080 8880 2052 2082 2086 2095

For requests made via HTTPS (only domains subscribed to Pro, Business, or Enterprise):

443 2053 2083 2087 2096 8443

my solution is create one sub-domain that not pass through cloudflare for any instance like ssh, python etc.

https://support.cloudflare.com/hc/en-us/articles/200169156-Which-ports-will-CloudFlare-work-with-

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top