Fixes #17 - configures Rails allowed hosts via env variables#39
Conversation
fef9626 to
bd99eeb
Compare
|
I initially wrote spec tests, but learned (the hard way) that within the Github CI environment, |
dolsysmith
left a comment
There was a problem hiding this comment.
Once I realized that it's necessary to restart nginx, too, as well as Rails, when making these changes, I was able to get it working as expected.
Note that in your instructions and the example ENV, you refer to the variable as ALLOWED_HOSTS_REGEX, but it should be (per your code) ALLOWED_HOST_REGEX.
|
@dolsysmith Thanks for catching that - I opted for |
What type of PR is this? (check all applicable)
Description
Adds two
.envparameters,ALLOWED_HOSTS_REGEXandHOST_NAME; their values are appended to (initially empty)Rails.application.config.hostsso that Rails allows requests from the host and/or regex. Note that both may be populated if desired.QA Instructions, Screenshots, Recordings
.envparameter. Confirm that you get a Rails error when trying to access the applicationHOST_NAMEwith your host name (e.g.ec2-1-2-3-4.us-west-2.compute.amazon.com) and confirm that you can access the applicationALLOWED_HOSTS_REGEXwith a regex that should include your host name (e.g..*\.compute\.amazonaws\.com/) and confirm that you can access the applicationAdded/updated tests?
[optional] Are there any post deployment tasks we need to perform?
Populate at least one of these parameters in
.env