ERR_TOO_MANY_REDIRECTS when trying to access Proxmox web interface externally through Cloudflare tunnel

syedalihussain

New Member
Jul 10, 2023
9
1
1
Hi, I wanted to access my proxmox server externally i.e. without being on my home network, and for that reason following a Youtube tutorial I setup a Cloudflare tunnel. I then spun up an LXC Container using an Ubuntu image. When I first did this, it all was working fine and dandy. Something has changed now in my proxmox server's configuration I believe that is causing me to see the `ERR_TOO_MANY_REDIRECTS` error in the chrome browser.

I also have a home assistant VM. I have also configured the same tunnel to access my home assistant VM and this works just fine. This is another reason that leads me to believe that something's amiss on the proxmox side. Note however that I can access my proxmox when on my home network.

Below is a log from cloudflared service running inside the LXC container. There are a lot of these which explains the above error. How can i solve this error and where can I find config for the web interface if there is any.

2023-07-13T17:17:52Z debug http GET https://proxmox.shahghomelab.com/ HTTP/1.1 {"cfRay":"7e632e937d692053-NRT","connIndex":2,"content-length":0,"headers":{"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Accept-Encoding":["gzip"],"Accept-Language":["en-GB,en;q=0.9"],"Cache-Control":["max-age=0"],"Cdn-Loop":["cloudflare"],"Cf-Connecting-Ip":["103.121.178.99"],"Cf-Ipcountry":["PK"],"Cf-Ray":["7e632e937d692053-NRT"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Cf-Warp-Tag-Id":["85e66a3c-10a0-4635-a457-734266002f06"],"Priority":["u=0, i"],"Sec-Ch-Ua":["\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Google Chrome\";v=\"114\""],"Sec-Ch-Ua-Mobile":["?0"],"Sec-Ch-Ua-Platform":["\"macOS\""],"Sec-Fetch-Dest":["document"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-Site":["none"],"Sec-Fetch-User":["?1"],"Upgrade-Insecure-Requests":["1"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"],"X-Forwarded-For":["103.121.178.99"],"X-Forwarded-Proto":["https"]},"host":"proxmox.shahghomelab.com","ingressRule":1,"path":"/"}
2023-07-13T17:17:52Z debug http 301 Moved Permanently {"cfRay":"7e632e937d692053-NRT","connIndex":2,"content-length":-1}
This looks like exact same issue as mine.
My proxmox version is 7.4-3. Any help would be highly appreciated
 
I have the same issues on my Nextcloud instance. On Vivaldi (chrome) I get "redirected you too many times" too, but on Firefox the error message is .
Code:
The page isn’t redirecting properly

An error occurred during a connection to nextcloud.xxxxxxx.org.

    This problem can sometimes be caused by disabling or refusing to accept cookies.

My first thought was that I used the wrong internal service address. I can access Nextcloud on http://192.168.1.40 and redirects to https. I tried this and also the network name, but the error stays the same. My Nexcloud instance is a CT based on Turnkey Linux. Proxmos is version 7.4-3.

The browser networking log is attached. Unfortunately, I don't know very much about how this should work, but while analyzing the logs it puzzled me that Nextcloud tried to use https for the redirection which doesn't work. After changing the apache nextcloud.conf file section for :80 to this it works now:

Code:
<VirtualHost *:80>
    UseCanonicalName Off
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/nextcloud/


    <IfModule mod_headers.c>
        Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
    </IfModule>
</VirtualHost>
 

Attachments

  • Nextcloud_tunnel_logs_23-07.log
    1.3 KB · Views: 4
Hey lucode. Thanks for sharing this. So you are accessing your proxmox through NextCloud tunnel is what I understand? You have your Turnkey Based Linux Container deployed in Proxmox?

I think the `<IfModule mod_headers.c>` section is what got the proxmox working for you but how exactly I am not sure. Maybe I'll give this another try today. There maybe something useful in these links.

https://www.reddit.com/r/CloudFlare/comments/12wii5g/proxmox_err_too_many_redirects/

This say:
On the public host name it needs to be HTTPs and with TLS certify check off
but I couldn't find how to turn off TLS certify check

https://community.cloudflare.com/t/community-tip-fixing-err-too-many-redirects/42335
https://developers.cloudflare.com/ssl/troubleshooting/too-many-redirects/
 
Hey lucode. Thanks for sharing this. So you are accessing your proxmox through NextCloud tunnel is what I understand? You have your Turnkey Based Linux Container deployed in Proxmox?

I think the `<IfModule mod_headers.c>` section is what got the proxmox working for you but how exactly I am not sure. Maybe I'll give this another try today. There maybe something useful in these links.

https://www.reddit.com/r/CloudFlare/comments/12wii5g/proxmox_err_too_many_redirects/

This say:

but I couldn't find how to turn off TLS certify check

https://community.cloudflare.com/t/community-tip-fixing-err-too-many-redirects/42335
https://developers.cloudflare.com/ssl/troubleshooting/too-many-redirects/
Yes of course it is a Proxmox container. The VirtualHost section I use is just a copy of the HTTPS VirtualHost section. So what
<IfModule mod_headers.c>
does I don't know.

"HTTPs and with TLS certify check off" seems to be the solution that uses HTTPS, but as I'm not familiar with Apache I can't help there. Certainly a not certified TLS doesn't work with a Tunnnel
 
Alright. The solution was in front of me the whole time. I had to select `https` under service type in the public hostname in the tunnels section and then the option for `no tls verify` appears. I had to select this and then it works.
 
  • Like
Reactions: Sai

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!