-
Notifications
You must be signed in to change notification settings - Fork 13
Introduce new attributes to enable the use behind a proxy #8
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,7 +283,14 @@ production: | |
port: <%=@prd_web_ui_port%> | ||
timeout: <%=@prd_web_ui_timeout%> | ||
access_log: '<%=@prd_log_dir-%><%=@prd_web_ui_accesslog-%>' | ||
<% if @prd_web_ui_base_url -%> | ||
base_url: '<%=@prd_web_ui_base_url-%>' | ||
<% end -%> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might be better expressed as: <% if @prd_web_ui_base_url %>
<% if @prd_web_ui_port %>
base_url: '<%= @prd_web_ui_base_url -%>:<%= @prd_web_ui_base_port -%>'
<% else %>
base_url: '<%=@prd_web_ui_base_url -%>'
<% end %>
<% end %> with similar behaviour for the other URL-handling sections. (Not sure what indenting is appropriate there, adjust as required.) It's actually probably better that these be handled in Flapjack code itself, but that'll be as part of a major version change/interface breakage I'd think. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to define a custom internal port for flapjack but not use this in public (similar to my comment above). I think this is not possible with your proposal or do I missunderstand the possibilities? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's treat this as the same problem as above (with a different manifestation :) |
||
<% if @prd_json_api_url -%> | ||
api_url: '<%=@prd_json_api_url-%>' | ||
<% else -%> | ||
api_url: '<%=@prd_json_api_base_url-%>:<%=@prd_json_api_port-%>/' | ||
<% end -%> | ||
# Full path to location of logo file, e.g. /etc/flapjack/custom_logo.png | ||
#logo_image_path: "/etc/flapjack/web/custom_logo/flapjack-2013-notext-transparent-300-300.png" | ||
logger: | ||
|
@@ -295,7 +302,11 @@ production: | |
port: <%=@prd_json_api_port%> | ||
timeout: <%=@prd_json_api_timeout%> | ||
access_log: '<%=@prd_log_dir-%><%=@prd_json_api_access_log%>' | ||
<% if @prd_json_api_url -%> | ||
base_url: '<%=@prd_json_api_url-%>' | ||
<% else -%> | ||
base_url: '<%=@prd_json_api_base_url-%>:<%=@prd_json_api_port-%>/' | ||
<% end -%> | ||
logger: | ||
level: <%=@prd_json_api_logger_level%> | ||
syslog_errors: <%=prd_jsonapi_syslog%> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
$prd_json_api_base_url
and$prd_json_api_url
should always be the same if specified? So the new variable is unnecessary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my point of view, the
$prd_json_api_base_url
is the internal url (behind a proxy). The$prd_json_api_url
is the public url in front of the proxy.Internal we run the flapjack-api on http://localhost:3081/ and external on https://hostname/flapjack/api/ (where apache is the proxy wo cares about the authentication)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that they're both used in the source code for values that will be used externally -- in pages or Location HTTP headers as appropriate. (Unless the proxy is doing some sort of translation I guess? I'd have to review things in that case.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think abount a config like this:
Flapjack:
Apache:
This results in http://localhost:3080/ URLs in the content of https://hostname/flapjack/ on our setup using Apache 2.2. on Debian Linux.
The only "workaround" I found was changing the
base_url
. Which should be independent of the port.