Virtual Hosts & Hosts File
For every project, LaraEnv writes a virtual host config and adds a matching entry to the Windows hosts file so <name>.<tld> resolves to your machine.
Where files live
- The per-project vhost is written to
C:\laraenv\nginx\conf\sites\<name>.conf(or the Apache equivalent underC:\laraenv\apache\...). - LaraEnv patches
C:\Windows\System32\drivers\etc\hoststo point<name>.<tld>→127.0.0.1.
Editing the hosts file requires Administrator rights, so LaraEnv needs to run elevated to add or remove these entries.
The vhost editor
The vhost editor lets you work with the generated config inline:
- Edit it with syntax highlighting.
- Save your changes.
- Reset to template to discard edits and regenerate the default config.
Example Nginx server block
server {
listen 80;
server_name mysite.test;
root C:/laraenv/www/mysite;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass php_upstream_84;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
The fastcgi_pass upstream points at the PHP-FPM pool for the version chosen in the project's configuration.
SSL
Enabling SSL generates a host certificate signed by LaraEnv's local CA under C:\laraenv\nginx\certs\ and configures HTTPS on the selected web server. The same local certificates are used by Nginx, Apache, and Caddy.
The installed edition attempts to trust its CA in Windows automatically. A portable copy asks for explicit trust, identifying that copy's CA. Review the CA identity and trust status in Settings. Portable copies store their certificates under their own root.
Changing the global TLD
Changing the global TLD (.test / .local / .dev) regenerates every vhost and hosts-file entry at once, so all projects switch to the new suffix together.