Path apps
Serve a folder, run a second PHP app, send a path to another site or limit a path to listed addresses.
On this page
Before you start
- You can open the site in Managed Websites. Anyone who can open a site can change its path apps, including which PHP files run.
- Each environment has its own path apps: choose Production or Staging in the site header first.
- An environment holds up to 16 path apps and 16 gates.
Add a path app
Open Path apps
Go to Managed Websites, choose the site, then Web server rules under Site settings. Choose the Path apps tab, then Add path app; on a site with no rules yet, choose Write rules first.
Start from a preset
Choose a preset, then Next. A preset only fills the form: every field can be changed before saving.
Fill in the path
Enter the Path, such as
/blog/, and the fields the preset needs: a Folder, a Target or Allowed addresses. Enter a Label, which names it in the Control Panel only, then choose Done.Save the rules
The path app is listed as Unsaved: new. Choose Save, review the change and choose Save again, as in Web server rules.
The path app is checked first, then applies straight away.
Choose a preset
| Preset | Use it to |
|---|---|
| WordPress admin (FishPig) | Run WordPress's admin, sign-in and REST API under a path. |
| WordPress full | Run a WordPress site under a path of another site. |
| Legacy PHP directory | Run the PHP files you list from a folder. Every other PHP file under the path is blocked. |
| Static directory | Serve the files in a folder, with no PHP. |
| Another site (proxy) | Serve the path from another website over HTTPS. Visitors stay on your address. |
| Single PHP entry | Run one PHP file. |
| IP / host gate | Let only listed addresses reach a path or a hostname. Everyone else gets a 403. |
| Start blank | Fill in every field yourself. |
Change or remove a path app
Use the row's buttons
Choose Edit on its row to change it, or open its … menu and choose Remove. Then choose Save.
Addresses on the environment's firewall list with SSH and website or Website only access always skip a path app's password and pass its gates. An SSH only address does not.
Automate this
Saves the hooks sent in content at the version you read: a hook left out stays as it is, and "" or null clears it.
curl -X PUT https://manage.corefinity.com/api/corestack/sites/1042/nginx-rules \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"note": "WordPress admin under /wp/",
"path_apps": [
{
"label": "Blog admin",
"php": {
"dir_index": [
"wp-admin/"
],
"entries": [
"wp-admin/*.php",
"wp-login.php"
],
"router": [
"wp-json/"
]
},
"prefix": "/wp/",
"preset": "wordpress-admin",
"root": "htdocs",
"type": "php-app"
}
],
"version": 0
}'Your assistant calls corestack_nginx_rules_update.
{
"name": "corestack_nginx_rules_update",
"arguments": {
"site_id": 4211,
"version": 7,
"content": {
"server": "location /wp-content/uploads/private/ {\n deny all;\n}\n"
},
"note": "Keep private uploads private"
}
}