implementing discovering static sites

This commit is contained in:
MeghdadFadaee committed 2026-07-04 15:02:30 +03:30
1 parent 17dfd5e49d
commit 0d320eaeb4
2 files changed
+51 -21

No files matched your search

+12 -7
View File
@@ -2,16 +2,18 @@
Local HTTPS router for PHP and Laravel projects.
`php-dev-router` discovers PHP apps in a projects directory, generates nginx
virtual hosts, adds exact local host records to `/etc/hosts`, and can run as a
small systemd watcher so newly added projects become available automatically.
`php-dev-router` discovers PHP apps and static HTML sites in a projects
directory, generates nginx virtual hosts, adds exact local host records to
`/etc/hosts`, and can run as a small systemd watcher so newly added projects
become available automatically.
It is built for development workstations, not production servers.
## Features
- Detects Laravel apps, public front-controller apps, and generic PHP apps.
- Generates HTTPS nginx server blocks backed by PHP-FPM.
- Detects Laravel apps, public front-controller apps, generic PHP apps, and
static HTML sites.
- Generates HTTPS nginx server blocks, with PHP-FPM routing where needed.
- Maps only detected project hostnames to `127.0.0.1`.
- Avoids wildcard DNS hijacking, so unrelated real domains keep resolving
normally.
@@ -23,7 +25,7 @@ It is built for development workstations, not production servers.
- Linux with systemd
- PHP 8.2 or newer
- nginx
- PHP-FPM
- PHP-FPM for PHP apps
- A local or trusted development certificate/key for the configured domain
The default example config uses `php.test`. Browsers will still require a
@@ -57,7 +59,7 @@ Start from `config.example.json`.
Important options:
- `projects_root`: directory that contains your PHP projects.
- `projects_root`: directory that contains your PHP projects and static sites.
- `domain`: suffix used for generated hostnames.
- `ssl_certificate` / `ssl_certificate_key`: certificate used by nginx.
- `php_fpm_socket`: PHP-FPM socket passed to nginx.
@@ -88,6 +90,9 @@ installs should let the tool run `nginx -t` before reload.
- Laravel app: `artisan` and `public/index.php`, served from `public`.
- Public front-controller app: `public/index.php`, served from `public`.
- Generic PHP app: `index.php`, served from that directory.
- Public static HTML site: `public/index.html` or `public/index.htm`, served
from `public`.
- Static HTML site: `index.html` or `index.htm`, served from that directory.
Ignored directories include hidden/tooling directories, `vendor`, `node_modules`,
`storage`, and common IDE/cache paths.