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

allow root to be configured

parent 4a0c0de7
...@@ -14,6 +14,7 @@ class NginxConfig ...@@ -14,6 +14,7 @@ class NginxConfig
json = {} json = {}
json = JSON.parse(File.read(USER_CONFIG)) if File.exist?(USER_CONFIG) json = JSON.parse(File.read(USER_CONFIG)) if File.exist?(USER_CONFIG)
json["port"] ||= ENV["PORT"] || 5000 json["port"] ||= ENV["PORT"] || 5000
json["root"] ||= "public_html/"
json["proxies"] ||= {} json["proxies"] ||= {}
json.each do |key, value| json.each do |key, value|
define_method(key) { value } define_method(key) { value }
......
...@@ -31,7 +31,7 @@ http { ...@@ -31,7 +31,7 @@ http {
listen <%= port %>; listen <%= port %>;
server_name _; server_name _;
keepalive_timeout 5; keepalive_timeout 5;
root public_html/; root <%= root %>;
<% proxies.each do |location, hash| %> <% proxies.each do |location, hash| %>
location <%= location %> { 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