-
-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Some files and Forms Being Served Over HTTP Instead of HTTPS #1622
Comments
I fixed the issue. I had to force https in code. Added forceSchema to boot function in app/Providers/AppServiceProvider.php
I don't think it's good, can we talk about why I had to do this? |
We are using asset() and route() helpers to generate correct URLs with the appropriate protocol (HTTP or HTTPS), the APP_URL in your .env file should be set correctly. Here's how to fix the issue: Update the APP_URL in your .env file: Ensure that the APP_URL is using the correct protocol (either HTTP or HTTPS) depending on your environment. For HTTPS: APP_URL=https://your-domain.com For HTTP: APP_URL=http://your-domain.com Clear the configuration cache, using below command, After updating the .env file, you need to clear the cache to apply the changes. Run the following command: php artisan optimize:clear |
@suraj-webkul I did what u wrote above. I have https url in the env file |
Hi @davidkobielski, Sometimes, it can be caused by a hot file. You can check the public folder for any hot files, and if found, simply delete them. Alternatively, you can run |
Hi,
I've encountered a strange issue where files like CSS, JS, and icons are being served over HTTP instead of HTTPS, which shouldn’t happen.
In my .env file, I have APP_URL set to HTTPS. HTML files and SVG logos are returned correctly over HTTPS, but the problem occurs with JS, CSS, and favicon files—they are served over HTTP.
Additionally, form URLs are also rendered with HTTP, for example:
<form action="http://domain.com/admin/#">
It seems the issue is related to the application. Could you help me investigate this?
Thanks in advance!
The text was updated successfully, but these errors were encountered: