Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update conf to use new format for environment vars

  • Loading branch information...
commit c3202fde31f82222f7ffa2219239ffe5b37b2130 1 parent 4c325c0
@jtarchie authored
Showing with 15 additions and 5 deletions.
  1. +15 −5 nginx.conf
View
20 nginx.conf
@@ -1,16 +1,26 @@
+<%
+ require "uri"
+ if ENV['DATABASE_URL']
+ database_url = URI.parse(ENV['DATABASE_URL'])
+ ENV['DB_HOST'] = database_url.host
+ ENV['DB_NAME'] = database_url.path.sub(/^\//,'')
+ ENV['DB_USERNAME'] = database_url.user
+ ENV['DB_PASSWORD'] = database_url.password
+ end
+%>
worker_processes 1;
events {
worker_connections 1024;
}
http {
upstream database {
- postgres_server $ENV_DB_HOST
- dbname=$ENV_DB_NAME
- user=$ENV_DB_USERNAME
- password=$ENV_DB_PASSWORD;
+ postgres_server <%= ENV['DB_HOST'] %>
+ dbname=<%= ENV['DB_NAME'] %>
+ user=<%= ENV['DB_USERNAME'] %>
+ password=<%= ENV['DB_PASSWORD'] %>;
}
server {
- listen $ENV_PORT;
+ listen <%= ENV['PORT'] %>;
location /venues {
postgres_pass database;
Please sign in to comment.
Something went wrong with that request. Please try again.