Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I the have following setup in my conf file

upload_set_form_field $ "$upload_file_name";

But I want change chosen param name to:

upload_set_form_field ($upload_field_name+"[name]") "$upload_file_name";

So I can get "attachment[name]" but this doesn't work. I would be very happy if someone could help me with merging variables with string in nginx config file :).

share|improve this question

This works:

set $foo = 'foo';
set $foobar "${foo}bar";
share|improve this answer
This worked for me! Thanks. I did this: set $object "$1"; set $object "${object}Display"; – Carl Bennett Dec 4 '15 at 19:48

Nginx does not have a concatenation character, rather it's based on valid and invalid characters, for instance in the directive:

try_files $uri $uri/ @fallback;

$uri is the variable and / is a string to append since / cannot be in a variable name.

Similarly you should try

$upload_field_name[name] "$upload_file_name";

If this doesn't work then try.

set $foo [name];
$upload_field_name$foo "$upload_file_name";

I cannot say if the upload module will even allow this, though. Minor syntax errors might also be present.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.