Nginx - client_max_body_size

Chris Bristow's Avatar

Chris Bristow

29 Oct, 2015 11:08 AM

Hi Support,

I'm trying to get the client_max_body_size setting to stick in Nginx, I tried applying it to nginx.conf but it was overwritten. I've tried creating a virtual host in the GUI (https://scalr-wiki.atlassian.net/wiki/display/docs/Configuring+Nginx+in+the+Scalr+UI) but that doesn't seem to work.

Just wondering if there is a way I can apply this setting to all traffic coming through the Nginx loadbalancer?

Cheers,

Chris

  1. 1 Posted by Hennadii Stas on 29 Oct, 2015 12:26 PM

    Hennadii Stas's Avatar

    Hello Chris,

    The directive client_max_body_size is being set by default in every nginx server section that's why the global one that you had set in nginx.conf was not working. You can edit template in Advanced Virtual Host Options (https://scalr-wiki.atlassian.net/wiki/display/docs/Configuring+Ngin... last section). So either remove it from there or set to desired value. Make sure to restart Scalarizr on server to apply the changes.

    Regards,
    Hennadii

  2. 2 Posted by Chris Bristow on 29 Oct, 2015 04:30 PM

    Chris Bristow's Avatar

    Hi Hennadii,

    Do I have to setup each individual URL as a proxy virtualhost or can apply the advanced settings to all traffic that goes through the loadbalancer somehow?

    Cheers,

    Chris

  3. 3 Posted by Hennadii Stas on 29 Oct, 2015 04:45 PM

    Hennadii Stas's Avatar

    Hello Chris,

    You can remove client_max_body_size from Advanced Options in each Proxy, edit nginx.conf so the directive will be defined there in http section and restart Scalarizr. This way you will have global client_max_body_size defined and no server-scope ones will override it. Also, Scalarizr doesn't overwrite the whole file, so your changes should persist.

    Regards,
    Hennadii

  4. Chris Bristow closed this discussion on 15 Dec, 2015 04:34 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

02 Jul, 2019 07:54 PM
07 Jun, 2019 07:12 PM
02 May, 2019 04:04 PM
28 Mar, 2019 05:24 PM
22 Feb, 2019 08:11 PM