Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mhdev's avatar

Password-protecting a subdomain

I've got a site, example.com, in Laravel Forge, that allows wildcard subdomains, e.g subdomain1.example.com and subdomain2.example.com.

Within my server on Forge, I've set up a single site, and I want to set up basic password protection, however I only want to password-protect one of my subdomains, I want the others to be publically accessible.

How do I do this?

In the Laravel UI, under "Security" I've added the route I want to protect to be subdomain1.example.com/* but this doesn't work. Is this possible to do via the Laravel UI, or do I need to amend the nginx config on the server?

0 likes
0 replies

Please or to participate in this conversation.