L
L
larik laravue2019-09-05 11:33:35
Laravel
larik laravue, 2019-09-05 11:33:35

How to solve the problem of working with api in laravel after switching to https?

The app worked great. The frontend on vue2 passed data to the backend (laravel) via the API and received the samples. Authorization through Laravel Passport.
Next, the server settings were changed so that the site became https and problems began
(in vue2, the address was also changed to https and port 81 was specified .
Registration works
. Account confirmation works.
Login works only partially. Email data, password, the server accepts and issues a token
, but no further api call fails. "User is not authorized"
401 (Unauthorized)
Here it gives out. No matter how I tried - it does not work.
The server is on Apache. It's not me who configures it, but the system administrator.
what we did was just change .htaccess but that didn't help. What can be wrong?
And maybe I don’t understand it right, but how to specify the port in laravel? The administrator says that you need to set port 81 in Laravel itself.
When accessing the api, I specify port 81 in the url https://test.ru:81/,....
but do I still need to do this in some config?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Razgelday, 2019-09-05
@Razgelday

Most likely, the problem is that you have a non-standard port for HTTPS.
The standard port for HTTPS is 443 , not 81.
If HTTPS is configured on this port, then you will not need to specify the port at all - just change the protocol from http:// to https://
81 port does not appear in the official list at all :
(see https://ru.wikipedia.org/wiki/%D0%A1%D0%BF%D0%B8%D...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question