Hi

New at using cloudflare. I’ve setup a tunnel to access my docker servers running at my home. Problem is that some of them don’t run at all.

For example: I have jellyfin.my-domain.com, http, works fine with the correct server ip 192.168.x.x, but if I try a docker container from another server, vikunja.my-domain.com, also http, doesn’t work with the correct ip 192.68.x.x. I also tried the docker name (http://vikunja:1234) with and without port number (both with ip and uri). It gives me an Error code 502: bad gateway and the logs of the cloudflared container (running on the same docker instance) gives me “The service may be down or it may not be responding to traffic from clouflared”. I should also point out that the container works when my tailscale vpn is running (so locally it works). What could be the problem here?

  • taxon@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    The Error 502 Bad Gateway you’re encountering usually means that Cloudflare is not receiving a response from your server or the server is taking too long to respond. Here are a few troubleshooting steps you can take to resolve the issue:

    Check your Docker setup: Make sure that the Docker container for the service (in this case vikunja) is running properly. You can do this by checking the logs of the Docker container or by trying to access the service locally. If the service is not running correctly, you may need to troubleshoot the Docker container itself.
    
    Check your Cloudflare configuration: Make sure that the Cloudflare tunnel is set up correctly for the service. You can do this by logging into the Cloudflare Tunnels dashboard and checking the settings for the specific service. One suggestion from reddit.com is to go to the "Public Hostname Page" for each of the domains that are having issues. Find where it says "Additional application settings" and open that section of the page. Then, under "TLS" look for "No TLS Verify" and set that to "Enabled".
    
    Check your network settings: Make sure that the service is accessible from the network where the Cloudflare tunnel is running. You can do this by trying to access the service from a different device on the same network.
    
    Check your application configuration: Some applications require specific settings to be configured in order to work correctly with Cloudflare. For example, in the case of Home Assistant, you might need to add trusted proxies in the configuration file reddit.com. Check the documentation for the specific application to see if there are any specific settings that need to be configured.
    

    Here is an example of how you might add trusted proxies in Home Assistant:

    http: use_x_forwarded_for: true trusted_proxies: 192.168.0.101 ip_ban_enabled: true login_attempts_threshold: 5

    Remember to replace 192.168.0.101 with the IP address of your Cloudflare tunnel server.

    If none of these steps resolve the issue, you may need to contact Cloudflare support or consult with the community forums for more specific troubleshooting advice.

    Remember to always backup your configuration files before making any changes, and to restart your services and/or server after making changes to ensure they take effect

    I’m not a bot, but this response was generated by GPT-4.