F
Filamentβ€’13mo 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β€’13mo 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
ChriisOPβ€’13mo ago
I land on the Filament Login page and can log in and use the app like in local
Dennis Koch
Dennis Kochβ€’13mo ago
So what's broken?
Chriis
ChriisOPβ€’13mo ago
When I use HTTPS
Matthew
Matthewβ€’13mo ago
okayy Can you show me your .env? Only the app_url Actually Does it have https there?
Chriis
ChriisOPβ€’13mo ago
No description
Chriis
ChriisOPβ€’13mo ago
Nope but when I changed it, it was the same
Dennis Koch
Dennis Kochβ€’13mo ago
Um? 1. It's not https 2. It's localhost? How do you expect that to work on a remote VPS?
Chriis
ChriisOPβ€’13mo ago
So what do I need to have as APP_URL if my domain name is test.com ?
Matthew
Matthewβ€’13mo ago
yeah, i agree with dennis
Dennis Koch
Dennis Kochβ€’13mo ago
test.com ?!
Chriis
ChriisOPβ€’13mo 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β€’13mo ago
Yes. If you URL is test.com you should put test.com as APP_URL
Matthew
Matthewβ€’13mo ago
It should look like this: APP_URL=https://wow.whatever.com
Chriis
ChriisOPβ€’13mo ago
So I changed for https://test.com (still an example)
Matthew
Matthewβ€’13mo 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β€’13mo ago
But probably without SSL? SSL Certificates for an IP is rather uncommon.
Chriis
ChriisOPβ€’13mo ago
Ok so with the right APP_URL I still have
No description
Dennis Koch
Dennis Kochβ€’13mo ago
Sounds like a misconfiguration of your server. As it's not a Laravel error.
Matthew
Matthewβ€’13mo ago
because you still need to configure your server to use SSL @Chriis
Chriis
ChriisOPβ€’13mo ago
But I don't know what I still have to do
Matthew
Matthewβ€’13mo ago
Do you know where your web server file is? Are you using nginx or apache?
Chriis
ChriisOPβ€’13mo ago
Apache
Dennis Koch
Dennis Kochβ€’13mo ago
It's hard to tell. We neither know your VPS, server infastructure, ... Is it even configured to accept SSL?
Chriis
ChriisOPβ€’13mo ago
Yes I think, the basic Apache welcome page worked in Https without problem
Matthew
Matthewβ€’13mo ago
Im not sure how apache works I always use nginx
Dennis Koch
Dennis Kochβ€’13mo ago
Try serving a simple HTML file via HTTPS until you get your configuration right
Matthew
Matthewβ€’13mo 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β€’13mo 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β€’13mo ago
Shouldn't be more complicated with Apache. Just a different configuration πŸ€·πŸΌβ€β™‚οΈ
Matthew
Matthewβ€’13mo ago
ehh. Personally, Ive always had issues with apache πŸ˜‚. Something always went wrong
Chriis
ChriisOPβ€’13mo ago
I cant change to Nginx currently 😬
DariusIII
DariusIIIβ€’13mo ago
Apache SSL Installation Instructions
Instructions for installing an SSL Certificate on an Apache Web Server.
DariusIII
DariusIIIβ€’13mo ago
Although, letsencrypt should do that for you
DariusIII
DariusIIIβ€’13mo 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
ChriisOPβ€’13mo ago
Thanks everyone, I ended up finding a solution πŸ™‚
Solution
Chriis
Chriisβ€’13mo ago
I just needed to recreate a SSL certificate with certbot ...
Chriis
ChriisOPβ€’13mo ago
Because I had a problem with the first one

Did you find this page helpful?