I set up consul and it works well in dev mode running bin/rails s -b 0.0.0.0 -p 8080
Now I want to run it in production mode, so I run bin/rails s -b 0.0.0.0 -p 8080 -e production
First error was:
Missing secret_token
and secret_key_base
for ‘production’ environment, set these values in config/secrets.yml
So I set secret_key_base
in config/secrets.yml
, which has already a secret_key_base
.
Bot no idea where to set secret_token
and in which format.
Anyhow I can now run bin/rails s -b 0.0.0.0 -p 8080 -e production
. The server is launched. But a browser cannot connect. See the output when trying to connect right from localhost in text mode:
consul@consul:~$ lynx http://localhost:8080
Looking up localhost:8080
Making HTTP connection to localhost:8080
Sending HTTP request.
HTTP request sent; waiting for response.
HTTP/1.1 301 Moved Permanently
Data transfer complete
HTTP/1.1 301 Moved Permanently
Using https://localhost:8080/
Looking up localhost:8080
Making HTTPS connection to localhost:8080
Alert!: Unable to make secure connection to remote host.
lynx: Can't access startfile http://localhost:8080/
consul@consul:~$
Why is a HTTPS redirection set up? How to disable it?
I would appreciate any help about how to run Consul in production mode.
Thank you very much.