Skip to content

Commit a91e550

Browse files
committed
[Bug Fix] Allow non-localhost hosts in docs development env
Rails 8's Host Authorization middleware blocks any Host header outside localhost/private IPs by default, so accessing the docs dev server through a VM hostname or Tailscale domain (e.g. devmachine.cloud) gets rejected with "Blocked hosts". Clear config.hosts in development since this is a non-public dev-only environment.
1 parent 139943a commit a91e550

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

docs/config/environments/development.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
# Enable server timing.
1616
config.server_timing = true
1717

18+
# Allow requests from any host in development (VM hostnames, tunnels, Tailscale, etc).
19+
config.hosts.clear
20+
1821
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
1922
# Run rails dev:cache to toggle Action Controller caching.
2023
if Rails.root.join("tmp/caching-dev.txt").exist?

0 commit comments

Comments
 (0)