Symfony2 - a separate subdomain for HTTPS connections

As you specify another subdomain for secure content: for example, in the security.yml file, I have the following in the access_control: section access_control:

 - { path: ^/Account/Login, access: isAnonymous(), requires_channel: https } 

This is good for my development environment because I have a self-signed template. In fact, in my production environment for this particular website, I have an existing SSL certificate that I would like to use instead of buying another.

So, tell me that my site is http://www.somesite.com/ , and access to safe materials should be available https://secure.somesite.com/ ... How do I tell Symfony2 instead?

+4
source share
1 answer

We hope host-based routes are a feature that will be available in Symfony 2.2. Take a look at Request Pull .

When the time comes, you can force HTTPS to be set for different URLs (as you do now) and add hostname requirements for your routes. Both things will allow you to use a separate subdomain for HTTPS connections.

At the same time, if you cannot wait for this feature to appear, you can try this blog article article .

Hope this helps.

+2
source

Source: https://habr.com/ru/post/1441628/


All Articles