I want my app server to only process requests to api.mydomain.com and return a 404 if any request is made using the server's IP address.
My stack is Rails on nginx/unicorn and I've implemented a custom cookbook that overrides unicorn/templates/default/nginx_unicorn_web_app.erb. I copied the template file that exists in this repository and added the following at the top of the template:
I stopped and started my server to ensure that the customized template file gets used, but when I issue a request using the server's IP address it still gets routed to my Rails app.
Is this <%= @instance[:ip] %> not correct? Is there a way to log from within this template file so that I can more easily debug what is going wrong? I tried using Chef::Log.info, but my message didn't seem to get logged.
I want my app server to only process requests to api.mydomain.com and return a 404 if any request is made using the server's IP address.
My stack is Rails on nginx/unicorn and I've implemented a custom cookbook that overrides unicorn/templates/default/nginx_unicorn_web_app.erb. I copied the template file that exists in this repository and added the following at the top of the template:
I stopped and started my server to ensure that the customized template file gets used, but when I issue a request using the server's IP address it still gets routed to my Rails app.
Is this
<%= @instance[:ip] %>
not correct? Is there a way to log from within this template file so that I can more easily debug what is going wrong? I tried using Chef::Log.info, but my message didn't seem to get logged.Thanks!