Skip to content

Commit fceba62

Browse files
authored
docs: clarify hostname route matching includes the port (#10568)
1 parent 0361d92 commit fceba62

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎user_guide_src/source/incoming/routing.rst‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,15 @@ by passing the "hostname" option along with the desired domain to allow it on as
476476
This example would only allow the specified hosts to work if the domain exactly matched **accounts.example.com**.
477477
It would not work under the main site at **example.com**.
478478

479+
.. note::
480+
481+
The ``hostname`` option is compared against the full ``HTTP_HOST`` value of the
482+
request, including the port when one is present. When your application is served
483+
on a non-standard port (for example ``localhost:8080``, behind Docker, or when
484+
using ``php spark serve``), you must include the port in the ``hostname`` option for
485+
the routes to match. For example, ``['hostname' => 'localhost:8080']`` matches only
486+
requests to ``localhost:8080``.
487+
479488
Restrict by Multiple Hostnames
480489
------------------------------
481490

0 commit comments

Comments
 (0)