F
Filamentβ€’6mo ago
Chriis

Filament app work on "http" but not on "https" on a VPS with SSL

Hi, my Filament app work on "http" but not on "https" on a VPS. I have configured a SSL certificate with Lets Encrypt. The classic key generate Laravel error worked on Https but as soon as I generated the key, the app was no longer working on https. Any idea ?
Solution:
I just needed to recreate a SSL certificate with certbot ...
Jump to solution
38 Replies
Dennis Koch
Dennis Kochβ€’6mo ago
app work on "http" but not on "https"
What does "work" mean? Any errors? The app key is unrelated to SSL Is your APP_URL correct?
Chriis
Chriisβ€’6mo ago
I land on the Filament Login page and can log in and use the app like in local
Dennis Koch
Dennis Kochβ€’6mo ago
So what's broken?
Chriis
Chriisβ€’6mo ago
When I use HTTPS
Matthew
Matthewβ€’6mo ago
okayy Can you show me your .env? Only the app_url Actually Does it have https there?
Chriis
Chriisβ€’6mo ago
No description
Chriis
Chriisβ€’6mo ago
Nope but when I changed it, it was the same
Dennis Koch
Dennis Kochβ€’6mo ago
Um? 1. It's not https 2. It's localhost? How do you expect that to work on a remote VPS?
Chriis
Chriisβ€’6mo ago
So what do I need to have as APP_URL if my domain name is test.com ?
Matthew
Matthewβ€’6mo ago
yeah, i agree with dennis
Dennis Koch
Dennis Kochβ€’6mo ago
test.com ?!
Chriis
Chriisβ€’6mo ago
1. Ok 2. I have another Filament app on another VPS where I access it with the IP directly and with the APP_URL as localhost. So I thought it was not a problem Its an example πŸ˜…
Dennis Koch
Dennis Kochβ€’6mo ago
Yes. If you URL is test.com you should put test.com as APP_URL
Matthew
Matthewβ€’6mo ago
It should look like this: APP_URL=https://wow.whatever.com
Chriis
Chriisβ€’6mo ago
So I changed for https://test.com (still an example)
Matthew
Matthewβ€’6mo ago
Then you need to configure your web server to use https (nginx/apche) Do you know where your web server file is?
Dennis Koch
Dennis Kochβ€’6mo ago
But probably without SSL? SSL Certificates for an IP is rather uncommon.
Chriis
Chriisβ€’6mo ago
Ok so with the right APP_URL I still have
No description
Dennis Koch
Dennis Kochβ€’6mo ago
Sounds like a misconfiguration of your server. As it's not a Laravel error.
Matthew
Matthewβ€’6mo ago
because you still need to configure your server to use SSL @Chriis
Chriis
Chriisβ€’6mo ago
But I don't know what I still have to do
Matthew
Matthewβ€’6mo ago
Do you know where your web server file is? Are you using nginx or apache?
Chriis
Chriisβ€’6mo ago
Apache
Dennis Koch
Dennis Kochβ€’6mo ago
It's hard to tell. We neither know your VPS, server infastructure, ... Is it even configured to accept SSL?
Chriis
Chriisβ€’6mo ago
Yes I think, the basic Apache welcome page worked in Https without problem
Matthew
Matthewβ€’6mo ago
Im not sure how apache works I always use nginx
Dennis Koch
Dennis Kochβ€’6mo ago
Try serving a simple HTML file via HTTPS until you get your configuration right
Matthew
Matthewβ€’6mo ago
even if he does, he still has to give permissions to write to storage with chmod. I think it gets more complicated with apache @Chriis Is there any particular reason you are using apche?
Matthew
Matthewβ€’6mo ago
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation β€” freeing you to create without sweating the small things.
Dennis Koch
Dennis Kochβ€’6mo ago
Shouldn't be more complicated with Apache. Just a different configuration πŸ€·πŸΌβ€β™‚οΈ
Matthew
Matthewβ€’6mo ago
ehh. Personally, Ive always had issues with apache πŸ˜‚. Something always went wrong
Chriis
Chriisβ€’6mo ago
I cant change to Nginx currently 😬
DariusIII
DariusIIIβ€’6mo ago
Apache SSL Installation Instructions
Instructions for installing an SSL Certificate on an Apache Web Server.
DariusIII
DariusIIIβ€’6mo ago
Although, letsencrypt should do that for you
DariusIII
DariusIIIβ€’6mo ago
How To Secure Apache with Let's Encrypt on Ubuntu 22.04 | DigitalO...
Let’s Encrypt is a Certificate Authority (CA) that facilitates obtaining and installing free TLS/SSL certificates, thereby enabling encrypted HTTPS on web se…
Chriis
Chriisβ€’6mo ago
Thanks everyone, I ended up finding a solution πŸ™‚
Solution
Chriis
Chriisβ€’6mo ago
I just needed to recreate a SSL certificate with certbot ...
Chriis
Chriisβ€’6mo ago
Because I had a problem with the first one
Want results from more Discord servers?
Add your server
More Posts