Struct static_web_server::settings::file::General
source · pub struct General {Show 39 fields
pub host: Option<String>,
pub port: Option<u16>,
pub root: Option<PathBuf>,
pub log_level: Option<LogLevel>,
pub cache_control_headers: Option<bool>,
pub compression: Option<bool>,
pub compression_level: Option<CompressionLevel>,
pub compression_static: Option<bool>,
pub page404: Option<PathBuf>,
pub page50x: Option<PathBuf>,
pub http2: Option<bool>,
pub http2_tls_cert: Option<PathBuf>,
pub http2_tls_key: Option<PathBuf>,
pub https_redirect: Option<bool>,
pub https_redirect_host: Option<String>,
pub https_redirect_from_port: Option<u16>,
pub https_redirect_from_hosts: Option<String>,
pub security_headers: Option<bool>,
pub cors_allow_origins: Option<String>,
pub cors_allow_headers: Option<String>,
pub cors_expose_headers: Option<String>,
pub index_files: Option<String>,
pub directory_listing: Option<bool>,
pub directory_listing_order: Option<u8>,
pub directory_listing_format: Option<DirListFmt>,
pub basic_auth: Option<String>,
pub fd: Option<usize>,
pub threads_multiplier: Option<usize>,
pub max_blocking_threads: Option<usize>,
pub grace_period: Option<u8>,
pub page_fallback: Option<PathBuf>,
pub log_remote_address: Option<bool>,
pub redirect_trailing_slash: Option<bool>,
pub ignore_hidden_files: Option<bool>,
pub health: Option<bool>,
pub experimental_metrics: Option<bool>,
pub maintenance_mode: Option<bool>,
pub maintenance_mode_status: Option<u16>,
pub maintenance_mode_file: Option<PathBuf>,
}
Expand description
General server options available in configuration file mode.
Note that the --config-file
option is excluded from itself.
Fields§
§host: Option<String>
Server address.
port: Option<u16>
Server port.
root: Option<PathBuf>
Root directory path.
log_level: Option<LogLevel>
Logging.
cache_control_headers: Option<bool>
Cache Control headers.
compression: Option<bool>
compression
or compression-gzip
or compression-brotli
or compression-zstd
or compression-deflate
only.Compression.
compression_level: Option<CompressionLevel>
compression
or compression-gzip
or compression-brotli
or compression-zstd
or compression-deflate
only.Compression level.
compression_static: Option<bool>
compression
or compression-gzip
or compression-brotli
or compression-zstd
or compression-deflate
only.Check for a pre-compressed file on disk.
page404: Option<PathBuf>
Error 404 pages.
page50x: Option<PathBuf>
Error 50x pages.
http2: Option<bool>
http2
only.HTTP/2 + TLS.
http2_tls_cert: Option<PathBuf>
http2
only.Http2 tls certificate feature.
http2_tls_key: Option<PathBuf>
http2
only.Http2 tls key feature.
https_redirect: Option<bool>
http2
only.Redirect all HTTP requests to HTTPS.
https_redirect_host: Option<String>
http2
only.HTTP host port where the redirect server will listen for requests to redirect them to HTTPS.
https_redirect_from_port: Option<u16>
http2
only.Host port for redirecting HTTP requests to HTTPS.
https_redirect_from_hosts: Option<String>
http2
only.List of host names or IPs allowed to redirect from.
security_headers: Option<bool>
Security headers.
cors_allow_origins: Option<String>
Cors allow origins feature.
cors_allow_headers: Option<String>
Cors allow headers feature.
cors_expose_headers: Option<String>
Cors expose headers feature.
index_files: Option<String>
List of files to be used as an index for requests ending with the slash character (‘/’).
directory_listing: Option<bool>
directory-listing
only.Directory listing feature.
directory_listing_order: Option<u8>
directory-listing
only.Directory listing order feature.
directory_listing_format: Option<DirListFmt>
directory-listing
only.Directory listing format feature.
basic_auth: Option<String>
basic-auth
only.Basic Authentication feature.
fd: Option<usize>
File descriptor binding feature.
threads_multiplier: Option<usize>
Worker threads.
max_blocking_threads: Option<usize>
Max blocking threads feature.
grace_period: Option<u8>
Grace period feature.
page_fallback: Option<PathBuf>
fallback-page
only.Page fallback feature.
log_remote_address: Option<bool>
Log remote address feature.
redirect_trailing_slash: Option<bool>
Redirect trailing slash feature.
Ignore hidden files feature.
health: Option<bool>
Health endpoint feature.
experimental_metrics: Option<bool>
experimental
only.Metrics endpoint feature (experimental).
maintenance_mode: Option<bool>
Maintenance mode feature.
maintenance_mode_status: Option<u16>
Custom HTTP status for when entering into maintenance mode.
maintenance_mode_file: Option<PathBuf>
Custom maintenance mode HTML file.