V
V
Vic Shostak2016-11-07 01:19:11
Digital certificates
Vic Shostak, 2016-11-07 01:19:11

How to configure HTTPS (SSL from Let's Encrypt) in Laravel 5.3 on shared hosting (Timeweb)?

Good!
When transferring a project (Laravel 5.3) from localhost to shared hosting (from Timeweb), I can't set up all pages to work via HTTPS protocol (SSL from Let's Encrypt, free). In the settings of my hosting control panel (Timeweb), a server redirect from HTTP to HTTPS is configured (this is where the server settings for shared servers, as the TP assured, end).
Everything works just like on a localhost, but you can’t authorize / register users + all the admin CRUD charms are also unavailable (it just redirects to the same page for any action without result).
I turn off HTTPS and the application works as intended, that is, the point is that secure data transfer is not configured somewhere in Laravel. I ask for help, because I'm still a junior in this wonderful framework.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vic Shostak, 2016-11-07
@vikkyshostak

As always, all answers are in the documentation: https://laravel.com/docs/5.3/helpers#method-secure-url
All you had to do was replace url()with secure_url()in the templates.

A
Andrzej Wielski, 2016-11-07
@wielski

The problem may be hiding in a completely unpredictable place.
The problem with the web middleware can be immediately dismissed, because in 5.3 it is automatically used in all web routes.
It is quite possible that you are sending requests over the http protocol. In the case of a redirect to https, of course, the session will be lost, the crsf key, respectively, too.
It would be nice to have a look at your project by poking and looking at the server headers during requests.
You can send it to me on VK or by mail [email protected], I will be happy to take a look and advise.
upd: First, try to do it by analogy (file /app/http/Kernel.php). If it does not help, write.
7c477000ea514da794c65623f027f7e1.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question