Commit 0e6f74d5 authored by Terence Lee's avatar Terence Lee

allow root to be configured

parent 4a0c0de7
......@@ -14,6 +14,7 @@ class NginxConfig
json = {}
json = JSON.parse(File.read(USER_CONFIG)) if File.exist?(USER_CONFIG)
json["port"] ||= ENV["PORT"] || 5000
json["root"] ||= "public_html/"
json["proxies"] ||= {}
json.each do |key, value|
define_method(key) { value }
......
......@@ -31,7 +31,7 @@ http {
listen <%= port %>;
server_name _;
keepalive_timeout 5;
root public_html/;
root <%= root %>;
<% proxies.each do |location, hash| %>
location <%= location %> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment