I have some nginx config in a repo, and the application root is sometimes different on different machines and setups:
server {
listen 80;
server_name admin.triface.local;
root /Users/xxxxxx/Sites/triface-admin/public;
index triface.html;
}
I want to set a variable somewhere (like an bash environment variable or equivalent) that lets me avoid hardcoding the server root. It seems like this should be straightforward, but I can’t find anything on it. Any clues?
So the answer is, there isn’t any! Intentionally! And once I read the reasoning, it actually made sense. Though it is a bummer I can’t do local nginx installs to people’s $HOME dir, but I can live with that.
See this stackoverflow answer:
How do I pass ImageMagick environment variables to nginx mongrels?