How to reverse proxy frankenphp #718
-
I have both my development and production environments running on a single Digital Ocean droplet, using a Frankenphp image. To ensure the correct application is served, I've implemented Caddy. Since Caddy handled SSL certificate creation, I disabled it within the Frankenphp image by setting SERVER_NAME: :80 in the compose.yaml file. When I visited example.com, it correctly displayed the Laravel default page, which was a good sign. However, when I attempted to log in, the styling failed to load because the CSS and JavaScript files were being served over HTTP internally. Browsers like Google Chrome don't allow this behavior. I attempted to resolve this issue by adding a global directive to the Caddyfile of my Caddy image, as suggested in the documentation. Unfortunately, this didn't work as expected. I also consulted the Caddy config documentation, but either my implementation was incorrect, or I misunderstood the instructions. Does anyone have an idea on how to resolve this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
CSS and JS urls is not a caddy issue, but something with your configuration and/or app code |
Beta Was this translation helpful? Give feedback.
Heh. It isn't. I could probably write a book about the problem you are stuck on, and we have all been stuck on some version of this problem. I don't want to spoil it for you because it's a good learning experience for how the web works... but I will give you a direction.
I recommend reading up on https://laravel.com/docs/11.x/urls and note:
So you need to figure out one of two options: