Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 1ba3e40

Browse files
authored
Merge pull request #8068 from magento/hg-gh8021-weballow
Cloud: update key value list for web locations
2 parents e78f24e + 8a6a5b7 commit 1ba3e40

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/cloud/project/magento-app-properties.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,26 @@ See [Services]({{ site.baseurl }}/cloud/project/services.html) for a full list o
7373

7474
### `web`
7575

76-
The `web` property defines how your application is exposed to the web (in HTTP). It determines how the web application serves content— from the front-controller script to a non-static request to an `index.php` file on the root. We support any directory structure so the static file can be in a sub directory, and the `index.php` file can be further down.
76+
The `web` property defines how your application is exposed to the web (in HTTP), determines how the web application serves content, and controls how the application container responds to incoming requests by setting rules in each location _block_. A block represents an absolute path leading with a forward slash (`/`).
7777

78-
You can specify the following attributes for the `web` property:
78+
```yaml
79+
web:
80+
locations:
81+
"/":
82+
# The public directory of the app, relative to its root.
83+
```
84+
85+
You can fine-tune your `locations` configuration using the following key values for each `locations` block:
7986

8087
Attribute | Description
8188
--------- | -----------
82-
`root` | The path relative to the root of the application that is exposed on the web. Typical values include `/public` and `/web`.
83-
`passthru` | The URL used in the event that a static file or PHP file cannot be found. This URL is typically the front controller for your applications, often `/index.php` or `/app.php`.
84-
`index` | Static files, such as `index.html`, to serve your application. This key expects a collection. You must include the static file(s) in the whitelist as an index file, like `- \.html$`.
85-
`blacklist` | A list of files that should never be executed. Has no effect on static files.
86-
`whitelist` | A list of static files (as regular expressions) that can be served. Dynamic files (for example, PHP files) are treated as static files and have their source code served, but they are not executed.
87-
`expires` | The number of seconds to cache whitelisted content in the browser. This attribute enables the cache-control and expires headers for static content. If this value is not set, the `expires` directive and resulting headers are not included when serving static content files.
88-
89-
Contrary to standard `.htaccess` approaches that accept a _blacklist_ and allow access to everything not on a specific list, we accept a _whitelist_, which means that any request that does not match triggers a 404 error and passes through to the URL specified by the `passthru` attribute.
89+
`allow` | Serve files that do not match "rules". Default value = `true`
90+
`expires` | Set the number of seconds to cache content in the browser. This key enables the `cache-control` and `expires` headers for static content. If this value is not set, the `expires` directive and resulting headers are not included when serving static content files. A negative 1 (`-1`) value results in no caching and is the default value. You can express time value with the following units: `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours), `d` (days), `w` (weeks), `M` (months, 30d), or `y` (years, 365d)
91+
`index` | List the static files to serve your application, such as the `index.html` file. This key expects a collection. This only works if access to the file or files is "allowed" by the `allow` or `rules` key for this location.
92+
`rules` | Specify overrides for a location. Use a regular expression to match a request. If an incoming request matches the rule, then regular handling of the request is overridden by the keys used in the rule.
93+
`passthru` | Set the URL used in the event that a static file or PHP file cannot be found. Typically, this URL is the front controller for your applications, such as `/index.php` or `/app.php`.
94+
`root` | Set the path relative to the root of the application that is exposed on the web. The public directory (location "/") for a Cloud project is set to "pub" by default.
95+
`scripts` | Allow loading scripts in this location. Set the value to `true` to allow scripts.
9096

9197
Our default configuration allows the following:
9298

0 commit comments

Comments
 (0)