cachethq / cachet

🚦 The open-source status page system.
https://cachethq.io
MIT License
13.79k stars 1.55k forks source link

Cachet is advertising href with the port 8000 when being behind a nginx reverse proxy #4312

Closed JAKAMI99 closed 10 months ago

JAKAMI99 commented 2 years ago

When using Cachet with an NGINX Reverse Proxy which is serving Cachet under a subdomain with https under the port 443, it suddenly starts advertising the path for scripts and the css stylesheet with the default port 8000 which is of course not reachable for an external connection.

grafik

Resulting in a total mess of a website and huge loading times until the connection for the scripts times out:

grafik

While it works internal in the network since the port makes sense

grafik

This is super weird since I don't have this issue for all my other subdomains and the problem just started appearing for a few weeks now...

Thanks in advance <3

welcome[bot] commented 2 years ago

:wave: Thank you for opening your first issue. I'm just an automated bot that's here to help you get the information you need quicker, so please ignore this message if it doesn't apply to your issue. If you're looking for support, you should try the Slack group by registering your email address at https://cachethq-slack.herokuapp.com. Alternatively, email support@alt-three.com for our Professional support service (please note, this a paid service.) If you're issue is with documentation, you can suggest edits by clicking the Suggest Edits link on any page, or open an issue at https://github.com/CachetHQ/Docs

d307473 commented 2 years ago

Same problem here after upgrading the docker image to latest version today. Adding all docker subnets 'proxies' => ['172.0.0.0/8'] to config/trustedproxy.php had no effect.

Temp fix by adding \URL::forceRootUrl("https://status.yoursite.net"); and \URL::forceScheme('https'); on top of the boot() function in app/Providers/AppServiceProvider.php

thomasthebro1 commented 2 years ago

Same problem here after upgrading the docker image to latest version today. Adding all docker subnets 'proxies' => ['172.0.0.0/8'] to config/trustedproxy.php had no effect.

Temp fix by adding \URL::forceRootUrl("https://status.yoursite.net"); and \URL::forceScheme('https'); on top of the boot() function in app/Providers/AppServiceProvider.php

I am also having the same problem. Where can I find this file to add the code?

d307473 commented 2 years ago

Same problem here after upgrading the docker image to latest version today. Adding all docker subnets 'proxies' => ['172.0.0.0/8'] to config/trustedproxy.php had no effect. Temp fix by adding \URL::forceRootUrl("https://status.yoursite.net"); and \URL::forceScheme('https'); on top of the boot() function in app/Providers/AppServiceProvider.php

I am also having the same problem. Where can I find this file to add the code?

app/Providers/AppServiceProvider.php

thomasthebro1 commented 2 years ago

Same problem here after upgrading the docker image to latest version today. Adding all docker subnets 'proxies' => ['172.0.0.0/8'] to config/trustedproxy.php had no effect. Temp fix by adding \URL::forceRootUrl("https://status.yoursite.net"); and \URL::forceScheme('https'); on top of the boot() function in app/Providers/AppServiceProvider.php

I am also having the same problem. Where can I find this file to add the code?

app/Providers/AppServiceProvider.php

More specifically, where can I find the app folder originating from when its a Docker image?

JAKAMI99 commented 2 years ago

Same problem here after upgrading the docker image to latest version today. Adding all docker subnets 'proxies' => ['172.0.0.0/8'] to config/trustedproxy.php had no effect. Temp fix by adding \URL::forceRootUrl("https://status.yoursite.net"); and \URL::forceScheme('https'); on top of the boot() function in app/Providers/AppServiceProvider.php

I am also having the same problem. Where can I find this file to add the code?

app/Providers/AppServiceProvider.php

More specifically, where can I find the app folder originating from when its a Docker image?

Use the console to view all files, if you are using a docker manager like UNRAID. Then cd into /var/www/html/app/Providers . In this directory you should find the AppServiceProvider.php.

Edit: sudo docker exec –it Cachet /bin/bash (for a console while using docker with the command line)

thomasthebro1 commented 2 years ago

Yes it works! Thank you so much everyone :) Btw sorry about the questions unrelated to the issue, I am still getting my head around docker and I am quite new to the environment.

UPDATE: The only problem I've found when using this method is that after you log into the dashboard the port number still gets appended to the end of the URL when you are running behind a reverse proxy such as Nginx.

jbrooksuk commented 10 months ago

Thank you for your input on Cachet 2.x. We are shifting our attention and resources to Cachet 3.x and will no longer be supporting the 2.x version. If your feedback or issue is relevant to the 3.x series, we encourage you to engage with the new branch.

For more information on the Cachet rebuild and our plans for 3.x, you can read the announcement here.

We appreciate your understanding and look forward to your contributions to the new version.