Corporate Bitrix often means several sites in one codebase: shop.client.ru, b2b.client.ru, separate admin. Production uses wildcard DNS and nginx. Locally, MacFullStack mirrors that with aliases, wildcard, and the correct docroot.
Basic Bitrix setup: /blog/bitrix-na-mac.
What to configure
- Docroot — real Bitrix folder (not just archive root); see /cms.
- Primary domain —
client.localhost(or a custom zone in Settings → Domains). - Aliases / subdomains —
b2b.client.localhost,admin.client.localhoston the same project. - Wildcard — for “any subdomain → one docroot” (WP Multisite-like); see /help/multisite.
- After changes — Sync vhosts and Health (orange hosts → sync hosts).
nginx instead of .htaccess
Native nginx does not read .htaccess. MacFullStack emits Bitrix rewrite/security rules; for multisite, every hostname must be in the vhost or the “second” site 404s while the main works.
Database and constants
- One MySQL, multiple
SITE_ID— like hosting; import via Tools → Databases. - Fix site URLs in
.settings.php/dbconn.phpfor local domains. - HTTPS via mkcert, port
:8443— watch Bitrix redirects.
Common issues
| Issue | Fix |
|---|---|
| Second site shows the main one | Aliases/wildcard + sync vhosts |
| 502 after import | Docroot, php-fpm, PHP version |
| Broken CSS | /bitrix/ paths and mixed http/https |
502/403 checklist: /blog/502-403-lokalno. Domains: /blog/domeny-i-multisite.