Returning JSON from an nginx proxy location

Eugene Brodsky's Avatar

Eugene Brodsky

01 Sep, 2016 06:46 PM

I'm trying to edit a location block in an nginx proxy backend to return some json. I created the backend, and am editing the free-form location block contents (under the "pencil" icon):

default_type application/json;
return 200 '{"some":"response"}';

This results in proxies.include being blank after scalarizr restart. When I comment out the "return" line (not even remove it), the proxies.include file is populated as expected (including the commented line).

If i edit proxies.include directly on the nginx server, all works fine.

This leads me to think Scalr has trouble parsing the "return..." line if it isn't commented out. Can i modify it somehow to allow for JSON return?

  1. Support Staff 1 Posted by Marat Komarov on 02 Sep, 2016 09:17 AM

    Marat Komarov's Avatar


    Confirming a bug in configuration parser of out Nginx role automation - it don't understand JSON as an option value. We're working on a fix.

    If you need a workaround, that is placing config into a file, and include ...; it in location template.


  2. 2 Posted by Eugene Brodsky on 02 Sep, 2016 03:07 PM

    Eugene Brodsky's Avatar

    Thank you, Marat. good workaround idea - definitely beats manually editing proxies.include anytime the farm role changes!

  3. 3 Posted by marc on 30 Sep, 2016 07:33 PM

    marc's Avatar

    Hi Eugene,

    Touching base to confirm if you have any questions or outstanding issues related to this ticket at this point. If not, we will be closing this ticket as resolved. Just let us know if you have any questions.

    Many thanks,
    Wm. Marc O'Brien
    Scalr Technical Support

  4. 4 Posted by Eugene Brodsky on 30 Sep, 2016 10:09 PM

    Eugene Brodsky's Avatar

    Marat's suggestion worked very well for us - thanks, this can be closed.

  5. marc closed this discussion on 30 Sep, 2016 10:10 PM.

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

Keyboard shortcuts


? 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