Introduce new attributes to enable the use behind a proxy#8
Introduce new attributes to enable the use behind a proxy#8mkobel wants to merge 1 commit intoflapjack:masterfrom
Conversation
* prd_web_ui_base_url : The public URL for flapjack * prd_json_api_url : The public URL for the flapjack-api
There was a problem hiding this comment.
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.
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.
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.
Do you think abount a config like this:
Flapjack:
web:
port: 3080
base_url: 'http://localhost:3080/'
Apache:
ProxyPass /flapjack/ http://localhost:3080/
ProxyPassReverse /flapjack/ http://localhost:3080/
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.
|
It might work better to merge in #11 and then look at if this one will merge cleanly, and whether any other pertinent issues from the above discussion still remain. |
This enables us to run flapjack on https://servername/flapjack/ with the following config:
flapjack
prd_json_api_url => 'https://monitoring/flapjack/api/',
prd_web_ui_base_url => 'https://monitoring/flapjack/',
apache
ProxyHTMLURLMap http://127.0.0.1:3080/ /flapjack/
ProxyHTMLExtended On
ProxyPass /flapjack/api/ http://127.0.0.1:3081/
ProxyPassReverse /flapjack/api/ http://127.0.0.1:3081/
ProxyPass /flapjack/ http://127.0.0.1:3080/
ProxyPassReverse /flapjack/ http://127.0.0.1:3080/