ISPConfig and CloudFlare

Discussion in 'General' started by Korsch, Dec 1, 2023.

Tags:
  1. Korsch

    Korsch New Member

    Im trying to set up Cloudflare for my server but im having some issues,Let me start off by saying im no expert and just a hobbits so im limited in what I know exactly. I can get it working on my main sites but I keep getting problems trying to get Cloudflare to work for my mail client at cp.domain.ca:8081 and for my control panel at cp.domain.ca:8080 ive pinned it down to the fact that my urls are ending in ports.
    Ive tried setting up page rules to redirect https:// to http:// because it seems Cloudflare keeps trying to direct to HTTPS,
    Ive tired to set up subdomains cp.example.com and mail.example.com and then use origin rules to set Cloudflare to connect to origin on ports 8080 and 8081 with no success. Im at a loss right now with what I really should be doing to get Cloudflare to work for my server.

    Any guidance would be much appreciated!
     
    Last edited: Dec 2, 2023
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    domain.ca and cp.domain.ca and/or *.domain.ca A record must point to you server IP or its cname to yout ddns domain FQDN if you use dynamic IP.

    Default CF settings normally work out of box in my experience.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    I guess you can not use CF proxy for any service besides ports 80 and 443. So you must turn off the proxy for the A-record of the server hostname and use this hostname to access ISPConfg GUI and webmail client.
     
  4. pyte

    pyte Well-Known Member HowtoForge Supporter

    till likes this.
  5. Korsch

    Korsch New Member

    The only thing I can get working is cloudflare for DNS providing. As soon as I try to mask my IP I run into issues where I can’t load the mail client and only being able to access my control panel through my servers IP address


    Code:
    A    @    IP_ADDRESS    600 seconds       
    
    A    cp    IP_ADDRESS    600 seconds       
    
    A    mail    IP_ADDRESS    600 seconds       
    
    NS    @    ns69.domaincontrol.com.    1 Hour   
    Can't delete
    Can't edit
    
    NS    @    ns70.domaincontrol.com.    1 Hour   
    Can't delete
    Can't edit
    
    CNAME    www    DOMAIN.ca.    1 Hour       
    
    CNAME    _domainconnect    _domainconnect.gd.domaincontrol.com.    1 Hour       
    
    SOA    @    Primary nameserver: ns69.domaincontrol.com.    1 Hour       
    
    MX    @    mail.DOMAIN.ca. (Priority: 10)    1 Hour       
    
    TXT    @    v=spf1 mx -all
    My DNS record looks like this now, but on Cloudflare the only difference was the addition of cloudflares name servers for NS
     
    Last edited: Dec 1, 2023
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Cloudflare does not support HTTPS for port 8080 (they use HTTP on that port only, see post from @pyte) and tey do not support port 8081 at all. So you can not use Cloudflare proxy to access ISPConfig on port 8080 or webmail on port 8081 at all. Plus CloudFlare proxies web traffic only, as far as I know, so you can not use their proxy for services like email (imap/pop3/smtp) when accessing it with a mail client.

    What you can do is that you change the ISPConfig GUI port and webmail port to a port supported by CloudFlare, if you do not want to disable CloudFlare proxy. Change port 8080 to 8880 in the file /etc/apache2/sites-available/ispconfig.vhost and port 8081 to 8443 in /etc/apache2/sites-available/apps.vhost and restart the web server.
     

Share This Page