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