Skip to content

Commit 598f2f7

Browse files
committed
docs: clarify hostname and subdomain route options include the port
The hostname and subdomain options are compared against the full HTTP_HOST value, including the port. Document that routes restricted by these options must include the port when the application is served on a non-standard port (e.g. localhost:8080, Docker, spark server).
1 parent c21d575 commit 598f2f7

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎user_guide_src/source/incoming/routing.rst‎

Lines changed: 14 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 ``spark server``), 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

@@ -502,6 +511,11 @@ that does not have any subdomain present, this will not be matched:
502511
Most domains should work fine but some edge case ones, especially with a period in the domain itself (not used
503512
to separate suffixes or www) can potentially lead to false positives.
504513

514+
.. note::
515+
516+
The ``subdomain`` option is also compared against the ``HTTP_HOST`` value, so when the application runs on a
517+
non-standard port, the port must be included as well (for example ``sub.example.com:8080``).
518+
505519
Offsetting the Matched Parameters
506520
=================================
507521

0 commit comments

Comments
 (0)