Skip to content

Documented how to force router to use https schema #12056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions routing/scheme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,11 @@ to always use ``http``.
to secure an "area" of your website (all URLs under ``/admin``) or when
you want to secure URLs defined in a third party bundle (see
:doc:`/security/force_https` for more details).

.. note::

When a script is running in CLI mode (e.g Symfony commands or messenger workers)
the router context is not defined and you may want to force the router to always
generate https or http urls. This can be achieved with specifying
``router.request_context.scheme: 'https'`` in your parameters. (see
:doc:`/console/request_context.rst` for more details).