FileServerConfig (proto)

This extension has the qualified name envoy.filters.http.file_server

Note

This extension is work-in-progress. Functionality is incomplete and it is not intended for production use.

This extension has an unknown security posture and should only be used in deployments where both the downstream and upstream are trusted.

Tip

This extension extends and can be used with the following extension category:

This extension must be configured with one of the following type URLs:

Warning

This API feature is currently work-in-progress. API features marked as work-in-progress are not considered stable, are not covered by the threat model, are not supported by the security team, and are subject to breaking changes. Do not use this feature without understanding each of the previous points.

extensions.filters.http.file_server.v3.FileServerConfig

[extensions.filters.http.file_server.v3.FileServerConfig proto]

A file server filter configuration.

{
  "manager_config": {...},
  "path_mappings": [],
  "content_types": {...},
  "default_content_type": ...,
  "directory_behaviors": []
}
manager_config

(extensions.common.async_files.v3.AsyncFileManagerConfig, REQUIRED) A configuration for the AsyncFileManager to be used to read from the filesystem.

path_mappings

(repeated extensions.filters.http.file_server.v3.FileServerConfig.PathMapping) The longest matching path_mapping takes precedence.

content_types

(repeated map<string, string>) A map from filename suffix (in lowercase) to content type header. e.g. {"txt": "text/plain"}

File suffixes may not contain . as the filename suffix after the last . is used to perform an O(1) lookup against the keys.

An empty string suffix will only match files ending with a ..

Files with no suffix (e.g. README) can be matched as the full string in lowercase. e.g. {"readme": "text/plain"}

default_content_type

(string) If content_types does not contain a match for a file suffix, default_content_type is used.

If there is no match and default_content_type is empty, the content-type header will be omitted from the response.

directory_behaviors

(repeated extensions.filters.http.file_server.v3.FileServerConfig.DirectoryBehavior) If the requested path refers to a directory, the given behaviors are tried in order until one succeeds. If the end of the list is reached with no success, the result is a 403 Forbidden.

extensions.filters.http.file_server.v3.FileServerConfig.PathMapping

[extensions.filters.http.file_server.v3.FileServerConfig.PathMapping proto]

{
  "request_path_prefix": ...,
  "file_path_prefix": ...
}
request_path_prefix

(string, REQUIRED) If no request_path_prefix is matched, the filter does not intercept a request.

If a request_path_prefix is matched, that prefix is removed from the request and replaced with file_path_prefix to form a filesystem path for the request.

Prefix / will match all GET requests.

file_path_prefix

(string, REQUIRED) Replaces a matched request_path_prefix to form a filesystem path for a request. May be relative to the working directory of the envoy execution, or an absolute path.

extensions.filters.http.file_server.v3.FileServerConfig.DirectoryBehavior

[extensions.filters.http.file_server.v3.FileServerConfig.DirectoryBehavior proto]

{
  "default_file": ...
}
default_file

(string) Attempts to serve the given file within the directory, e.g. index.html. Precisely one of default_file and list must be set per DirectoryBehavior.