Advanced Nginx Configuration

Its time that we start configuring our nginx application to talk to the backend service and do some real data manipulation.


  • Copy over the default nginx.conf provided by the buildpack from here, commit
  • remove unwanted lines: commit
  • Hardcod the server URL as the proxy commit
  • But Hard code won't work, the server URL may change with environment, like DEV/production/QA, So we have to externalize the configuration. commit
    • Explanation: The Static buildpack uses something called ERB to template the nginx.conf
    • Reference to Buildpack code that does the erb
    • So basically <%= ENV["TODO_SERVER_URL"] %> entry gets replaced into which happens to be the env in manifest.yml
    • So now any request to will be redirected to todo-server succefully
  • Complete list of changes can be found in Pull Request