Sunday, February 03, 2019

httpd option max body size is ignored for subdomain

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE+GwVq2/+b4FD10wemL9bovO7TSgFAlxXDB4ACgkQmL9bovO7
TSgnHBAAvrzYijKAN6xmiIqYTohQaBfSjpt0kPNlq7GRT+iV+apI/7lFiFRp2YHv
A53B/clePM/4Dqil2Fl7s70fJWJpr11Ajt54iZb1uSvRi5HwYV/hOjTTnX/biz3G
MQoiBpWxtJGEo/azMSZ71D5avIudiY8/5RSszkqFLdMXpy+EePOE55E91zWZ41ru
P2iyNH4/PUPbr0Kg5AukDRCUnVhh966svmOViSyAjUUPRXV5aRbIRFqM7uFuQuvI
VudVVuNUY0jP5+MT/HMFRTKGrZCS/uy9wYHryOsDfahIWQDBrG6/C8R1xSm7KT0e
5vr2Z24i0slLsqx+i7JCBl9kzVCwMFtqHo/pavLggq/7fhS5qic+GfPTpU9G+Lsg
/8vBSxETdL3lIKhUIBcrdoSmvOE2fXc6sMkG4SWivqxQrTkYXGF5qjdMf9jP7nmG
0GCxyJnl/Sxb1dAQYXMIwEFdGtlaWVAjnijoFBEZso3njDH1XRXSeiTeVaZ4/AiW
LxFIoplqHNVzWSWZutJIhZr+pFha0KXWQQ2CrZ6vgkzxld5Dnv1aeftjaeyPojHK
lFM4qXLr5UiS9tXrMuwgeHmvnYhrjPG3i6ly+ZIcpWNp8STvAJafcW1OBfW1FiNy
xtbDusZzuFs8Q+wEdegKQTi9rXonjKl3kQTCu5PIPDct/zthQbQ=
=k2xB
-----END PGP SIGNATURE-----
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.

default vhost:

server "default" {
listen on * port 80

location "/.well-known/acme-challenge/*" {
root "/acme"
request strip 2
}

location * {
block return 404
}
}

server "default_tls" {
listen on * tls port 443
tls certificate ...
tls key ...

# I must place max request body here, but why?
# connection max request body 536870912

location * {
block return 403
}
}


nextcloud vhost:

server "nextcloud.mydomain.com" {
listen on * tls port 443
...
# this is ignored! It takes setting from "default_tls"!
connection max request body 536870912
}

server "nextcloud.mydomain.com" {
listen on * port 80;
location "/.well-known/acme-challenge/*" {
root "/acme"
request strip 2
}

block return 301 "https://nextcloud.mydomain.com$REQUEST_URI"
}


When I try PUT a file to nextcloud.mydomain.com, my access.log tells me
that this request is handled by default_tls:

default_tls xx.xx.xx.xx - - [03/Feb/2019:14:38:35 +0000] "PUT
/remote.php/webdav/bigger-file.png HTTP/1.1" 413 0

For smaller files with body <1024k (default body limit) it works ok:

nextcloud.mydomain.com xx.xx.xx.xx - - [03/Feb/2019:14:39:51 +0000] "PUT
/remote.php/webdav/smaller-file.png HTTP/1.1" 201 0

Why is httpd not specting subdomain config?

No comments:

Post a Comment