trabajo-afectivo/lib/knowledge_base/server_snippet_nginx.rb

30 lines
771 B
Ruby
Raw Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
2019-06-04 03:40:48 +00:00
class KnowledgeBase
class ServerSnippetNginx < ServerSnippet
def template_path
<<-ERB.strip_heredoc
# Add following lines to "server" directive
rewrite ^#{path}(.*)$ /help$1 last;
ERB
end
def template_full
<<-ERB.strip_heredoc
# Add following lines to "server" directive
if ($host = #{host} ) {
rewrite ^/(api|assets)/(.*)$ /$1/$2 last;
rewrite ^#{path}(.*)$ /help$1 last;
}
ERB
end
def template_original_url
<<-ERB.strip_heredoc
# Add following line to "Location /" directive, before other proxy_set_header
proxy_set_header X-ORIGINAL-URL $request_uri;
ERB
end
end
end