Score:0

Different environment variables for different nginx configurations

in flag

I want to link up different linux environment variables to different nginx configurations.

I have:

  1. react-app-1.conf - nginx config in sites-available directory, one of my react appplication.
  2. react-app-2.conf - nginx config in sites-available directory, another react application.

The problem:

Both of my react applications needs to access different environment variables. Setting up global linux distrubution environment variable for example NODE_ENV (this is just the example) links it globally, and all of the conf files share the same environment variable (as far as I understood, that's the current behavior I'm having).

Is there any way to seperate environment variables for different nginx.conf files? What's the best practice on storing these environment variables across multiple configs?

djdomi avatar
za flag
Questions seeking installation, configuration or diagnostic help must include the desired end state, the specific problem or error, sufficient information about the configuration and environment to reproduce it, and attempted solutions. Questions without a clear problem statement are not useful to other readers and are unlikely to get good answers.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.