1

I currently use nginx with Magento and I use the map directive to supply the store code like this:

map $http_host $magecode {
        www.store.com retail_store;
        wholesale.store.com wholesale_store;
        beta.store.com retail_beta_view;
}

The drawback to this is if I make the beta site its own store, I can't use the same catalog. Instead, I want to make the beta site a website instead of store.

Is it possible to map two variables at a time? I am imagining it would look like this:

map $http_host $magecode $magetype {
        www.store.com retail_store website;
        wholesale.store.com wholesale_store website;
        beta.store.com retail_beta_view store;
}

If not can I map the same variable twice?

map $http_host $magecode { ... }
map $http_host $magetype { ... }

1 Answer 1

2

Yes, you can use more than one map and that seems to be the cleanest way to solve this.

map $http_host $magecode {
        www.store.com retail_store;
        wholesale.store.com wholesale_store;
        beta.store.com retail_beta_view;
}

map $http_host $magetype {
        www.store.com website;
        wholesale.store.com website;
        beta.store.com store;
}
1
  • That worked perfectly. Thanks for the prompt response!
    – Alex Block
    Jun 30, 2014 at 17:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .