E
E
e-hot2017-05-31 10:03:17
symfony
e-hot, 2017-05-31 10:03:17

How to properly configure work with HTTPS in Symfony2 in security?

Greetings.
Description of the situation: the project on the VPS (Ubuntu14.04) was originally made as a project running on the http protocol, later it was necessary to switch to https - all the settings were made on the local machine to test working with this https protocol - the frontend works fine, but when testing the work the backend of the project had questions:
1. First, when authorizing with the previous security settings (as for http ), naturally, the page of the authorized personal account was not displayed, manually added https:// to the address project.local/account - it turned out https://project.local / account and personal account displayed.

2. I looked for information about the security settings in relation to https, namely:
access_control:
- { path: ^/, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/account, roles: ROLE_USER, requires_channel: https }
tried it - didn't work

further poyuzal:
account:
pattern: /account
defaults: { _controller: AcmeAppBundle:Account:account }
schemes: [https]
I tried it - it didn't work

3. When I log out via /account/logout from the personal cab, which was displayed manually by adding https in the address, it also throws me to the project.local address without displaying the page, I had to manually add https again :// to project.local/account/logout and in this case I was successfully kicked out to https://project.local

Question: tell me exactly what settings you need to change so that the entrance to the protected part of the project and the exit from it in the presence of the HTTPS protocol occur correctly. Thanks in advance.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question