Changed X-Frappe-Site-Name header to use value from $host
instead o…
#184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…f
$http_host
in nginx configurationISSUE
$http_host
is used for setting header 'X-Frappe-Site-Name'which adds port number to the header along with the host value. Frappe source app.py expects the header
value to contain only the host name and not the port number. So
$host
should be used instead of$http_host
to set the 'X-Frappe-Site-Name' header$http_host
vs$host
in nginx$http_host
contains the host name along with port number whereas$host
contains only the host name in lowercase without the port number.From the frappe source file app.py, X-Frappe-Site-Name is used if its set.
Since
$host
variable will never contain port number which is not the case with$http_host
,$host
should be used for setting the header 'X-Frappe-Site-Name'. Otherwise we have issues with site serving.Tested the above changes in compose as well as in swarm environment.
In compose, tested the site with host mapping of 80 and 8000. Works with both the host port mapping.
Tested with erpnext version - v12.5.2
Changes to be committed:
modified: build/common/nginx-default.conf.template