Reverse Proxy with Nginx

Green Screen

Cadet
Joined
Mar 13, 2024
Messages
7
Hello All, This would be my first post and I am hoping to help other in the future.

My issue is as following. some apps in the official Truenas apps have a certification option like Vaultwarden and file browser and it's easy to setup within Cloudflare tunnel. unfortunately almost all other apps don't have this option why is this?

So the other option is using nginx since I dont want to use (traefik) truecharts apps because of the many breaking changes that have been there lately. now my issue is that everything seems to be setup fine when in Cloudflare and nginx but when I want to acces the webpage I get host error message with error 522 my first guess is that this is related because I am unable to port 443 and 80 because Kubernetes doesn't seem to go below 9000 and I am not sure the best way to resolve this. I have tried to forward the ports In my router but the same issue persists. I have tried for 2 days now and I can't seem to figure it out.

Screenshot 2024-03-13 at 9.55.57 PM.png
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Hello All, This would be my first post and I am hoping to help other in the future.

My issue is as following. some apps in the official Truenas apps have a certification option like Vaultwarden and file browser and it's easy to setup within Cloudflare tunnel. unfortunately almost all other apps don't have this option why is this?

So the other option is using nginx since I dont want to use (traefik) truecharts apps because of the many breaking changes that have been there lately. now my issue is that everything seems to be setup fine when in Cloudflare and nginx but when I want to acces the webpage I get host error message with error 522 my first guess is that this is related because I am unable to port 443 and 80 because Kubernetes doesn't seem to go below 9000 and I am not sure the best way to resolve this. I have tried to forward the ports In my router but the same issue persists. I have tried for 2 days now and I can't seem to figure it out.

View attachment 76555
Are you using cloudflares proxy (orange cloud) setting in your dns settings?

If so, disable it as that will only allow ports 80 and 443. It will not let you use other ports.

The other option is to use the cloudflared app, but I don’t know if that’s available as an IX app.
 

victort

Guru
Joined
Dec 31, 2021
Messages
973
Thank you for your reply. I turned them off and back on doesn't seem to matter much.
So you,

1. Turned them off
2. Visited your domain:9000 or whatever port you have
3. Had that port forwarded to your SCALE server

What the error you get in your browser?
 

Green Screen

Cadet
Joined
Mar 13, 2024
Messages
7
So you,

1. Turned them off
2. Visited your domain:9000 or whatever port you have
3. Had that port forwarded to your SCALE server

What the error you get in your browser?
Sorry for my late reply.

I have Nginx proxy manger installed in Truenas scale with the standard kubernetes port these are forwarded to my router with the ip that i use for the truenas server. in cloudflare i have cname records set with the subdomain these are proxied and i have my public ip (whatismyipadress.com) set here with my domain for the ssl certificate in and a record. right now i am getting Web server is down error 521.
 

Green Screen

Cadet
Joined
Mar 13, 2024
Messages
7
I actually fixed it by using the cloudflare tunnel and use http instead of https and noTLSVerify.
 

Green Screen

Cadet
Joined
Mar 13, 2024
Messages
7
Would you know by any change how to solve this with https if I try it with https and noTLSVerify. I get a bad gateway error. probably something to do with the certificate but not sure how to solve this.
 

Green Screen

Cadet
Joined
Mar 13, 2024
Messages
7
Solved the issue with https too. just select in the tunnel http and go to your website - SSL/TLS - Edge Certificates - Always use HTTPS. then when you visit [URL]http://website.com[/URL] it changes to [URL]https://website.com[/URL]
hopefully this will help other folks in the future.
 
Last edited by a moderator:
Top