# HG changeset patch # User Olaf Wintermann # Date 1773950401 -3600 # Node ID b240ff52cee5e08efe89da8c40aa998860cec02b # Parent f707afcd42186caca725678ffdb4eb6e2a365e25 add proxy settings to location config diff -r f707afcd4218 -r b240ff52cee5 src/server/daemon/location.c --- a/src/server/daemon/location.c Wed Mar 18 21:42:35 2026 +0100 +++ b/src/server/daemon/location.c Thu Mar 19 21:00:01 2026 +0100 @@ -116,6 +116,26 @@ if(cxListAdd(location->rewrite, rule)) { return 1; } + } else if(!cx_strcasecmp(name, "ProxyPass")) { + location->config.proxy_url = cx_strdup_a(a, dir->args->value); + if(!location->config.proxy_url.ptr) { + return 1; + } + } else if(!cx_strcasecmp(name, "ProxyHeader")) { + if(!location->config.proxy_headers) { + location->config.proxy_headers = cxLinkedListCreate(a, CX_STORE_POINTERS); + if(!location->config.proxy_headers) { + return 1; + } + } + StringTemplate *header_tpl = string_template_compile(a, cx_strcast(dir->args->value)); + if(!header_tpl) { + return 1; + } + if(cxListAdd(location->config.proxy_headers, header_tpl)) { + string_template_free(header_tpl); + return 1; + } } return 0; diff -r f707afcd4218 -r b240ff52cee5 src/server/daemon/location.h --- a/src/server/daemon/location.h Wed Mar 18 21:42:35 2026 +0100 +++ b/src/server/daemon/location.h Thu Mar 19 21:00:01 2026 +0100 @@ -97,6 +97,17 @@ cxmutstr docroot; /* + * Reverse proxy url + */ + cxmutstr proxy_url; + + /* + * Reverse proxy header list + * Value: StringTemplate* + */ + CxList *proxy_headers; + + /* * Redirect URL * Can contain references to regex capture groups (redirect match regex, * if available, or the location regex)