zammad/lib/knowledge_base/server_snippet_nginx.rb
2026-01-02 15:41:09 +02:00

29 lines
747 B
Ruby

# Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
class KnowledgeBase
class ServerSnippetNginx < ServerSnippet
def template_path
<<~ERB
# Add following lines to "server" directive
rewrite ^#{path}(.*)$ /help$1 last;
ERB
end
def template_full
<<~ERB
# 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
# Add following line to "Location /" directive, before other proxy_set_header
proxy_set_header X-ORIGINAL-URL $request_uri;
ERB
end
end
end