On Sun, Feb 03, 2019 at 03:43:20PM +0000, Chris Narkiewicz wrote: > Hi, > > I'm trying to configure Nextcloud on a subdomain. My config has 2 > vhosts and connection max request body is not respected for my subdomain.
this has been fixed in current. Wild guess, you are on 6.4? This diff should apply cleanly to stable sources: Index: server_http.c =================================================================== RCS file: /cvs/src/usr.sbin/httpd/server_http.c,v retrieving revision 1.127 retrieving revision 1.128 diff -u -p -r1.127 -r1.128 --- server_http.c 4 Nov 2018 05:56:45 -0000 1.127 +++ server_http.c 4 Dec 2018 18:12:08 -0000 1.128 @@ -198,7 +198,6 @@ void server_read_http(struct bufferevent *bev, void *arg) { struct client *clt = arg; - struct server_config *srv_conf = clt->clt_srv_conf; struct http_descriptor *desc = clt->clt_descreq; struct evbuffer *src = EVBUFFER_INPUT(bev); char *line = NULL, *key, *value; @@ -357,11 +356,6 @@ server_read_http(struct bufferevent *bev server_abort_http(clt, 500, errstr); goto abort; } - if ((size_t)clt->clt_toread > - srv_conf->maxrequestbody) { - server_abort_http(clt, 413, NULL); - goto abort; - } } if (strcasecmp("Transfer-Encoding", key) == 0 && @@ -1332,6 +1326,12 @@ server_response(struct httpd *httpd, str /* Now search for the updated location */ srv_conf = server_getlocation(clt, desc->http_path); + } + + if (clt->clt_toread > 0 && (size_t)clt->clt_toread > + srv_conf->maxrequestbody) { + server_abort_http(clt, 413, NULL); + return (-1); } if (srv_conf->flags & SRVFLAG_BLOCK) { -- I'm not entirely sure you are real.