Commit 3141310e authored by Terence Lee's avatar Terence Lee

custom error pages

parent 32a44de4
...@@ -21,6 +21,7 @@ class NginxConfig ...@@ -21,6 +21,7 @@ class NginxConfig
json["routes"] ||= {} json["routes"] ||= {}
json["routes"] = Hash[json["routes"].map { |route, target| [to_regex(route), target] }] json["routes"] = Hash[json["routes"].map { |route, target| [to_regex(route), target] }]
json["redirects"] ||= {} json["redirects"] ||= {}
json["error_page"] ||= nil
json.each do |key, value| json.each do |key, value|
self.class.send(:define_method, key) { value } self.class.send(:define_method, key) { value }
end end
......
...@@ -31,6 +31,9 @@ http { ...@@ -31,6 +31,9 @@ http {
listen <%= port %>; listen <%= port %>;
keepalive_timeout 5; keepalive_timeout 5;
root <%= root %>; root <%= root %>;
<% if error_page %>
error_page 404 500 /<%= error_page %>;
<% end %>
<% if clean_urls %> <% if clean_urls %>
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