I’m new to discourse and started diving into it by setting up a development system, following this howto.
Afterwards I was able to access my instance via ip address, but trying to access via hostname fails with following message:
Blocked host: discourse_example_net
To allow requests to discourse_example_net, add the following to your environment configuration:
config.hosts << “discourse_example_net”
I found this PR, but I don’t know how to set the env var.
You can prepend DISCOURSE_DEV_HOSTS=discourse_example_net to the command that starts the unicorn server, or you can set the variable in your ~/.bashrc (or the rc file of the shell you use).
Estou assumindo que, ao dizer “não funcionou”, você ainda está recebendo o mesmo erro que o OP? Parece que você está usando o Docker para desenvolvimento, então precisa definir essa variável de ambiente dentro do contêiner, e não na máquina host. Eu não uso o Docker para desenvolvimento, mas parece que o d/boot_dev pode definir variáveis dentro do contêiner para você: