pub struct LocationConf {Show 14 fields
pub upstream: Option<String>,
pub path: Option<String>,
pub host: Option<String>,
pub proxy_set_headers: Option<Vec<String>>,
pub proxy_add_headers: Option<Vec<String>>,
pub rewrite: Option<String>,
pub weight: Option<u16>,
pub plugins: Option<Vec<String>>,
pub client_max_body_size: Option<ByteSize>,
pub max_processing: Option<i32>,
pub includes: Option<Vec<String>>,
pub grpc_web: Option<bool>,
pub enable_reverse_proxy_headers: Option<bool>,
pub remark: Option<String>,
}Expand description
Configuration for a location/route that handles incoming requests
Fields§
§upstream: Option<String>Name of the upstream service to proxy requests to
path: Option<String>URL path pattern to match requests against Can start with:
- “=” for exact match
- “~” for regex match
- No prefix for prefix match
host: Option<String>Host/domain name to match requests against
proxy_set_headers: Option<Vec<String>>Headers to set on proxied requests (overwrites existing)
proxy_add_headers: Option<Vec<String>>Headers to add to proxied requests (appends to existing)
rewrite: Option<String>URL rewrite rule in format “pattern replacement”
weight: Option<u16>Manual weight for location matching priority Higher weight = higher priority
plugins: Option<Vec<String>>List of plugins to apply to requests matching this location
client_max_body_size: Option<ByteSize>Maximum allowed size of request body
max_processing: Option<i32>Maximum number of concurrent requests being processed
includes: Option<Vec<String>>List of included configuration files
grpc_web: Option<bool>Whether to enable gRPC-Web protocol support
enable_reverse_proxy_headers: Option<bool>Whether to enable reverse proxy headers
remark: Option<String>Optional description/notes about this location
Implementations§
Source§impl LocationConf
impl LocationConf
Sourcepub fn hash_key(&self) -> String
pub fn hash_key(&self) -> String
Generates a unique hash key for this location configuration Used for caching and comparison purposes
Sourcepub fn get_weight(&self) -> u16
pub fn get_weight(&self) -> u16
Calculates the matching priority weight for this location Higher weight = higher priority Weight is based on:
- Path match type (exact=1024, prefix=512, regex=256)
- Path length (up to 64)
- Host presence (+128)
Returns either the manual weight if set, or calculated weight
Trait Implementations§
Source§impl Clone for LocationConf
impl Clone for LocationConf
Source§fn clone(&self) -> LocationConf
fn clone(&self) -> LocationConf
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LocationConf
impl Debug for LocationConf
Source§impl Default for LocationConf
impl Default for LocationConf
Source§fn default() -> LocationConf
fn default() -> LocationConf
Source§impl<'de> Deserialize<'de> for LocationConf
impl<'de> Deserialize<'de> for LocationConf
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for LocationConf
impl Hash for LocationConf
Auto Trait Implementations§
impl Freeze for LocationConf
impl RefUnwindSafe for LocationConf
impl Send for LocationConf
impl Sync for LocationConf
impl Unpin for LocationConf
impl UnwindSafe for LocationConf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request