I would like to know the current url with elixir / phoenix framework, how I can get this ?
Edit #1:
My nginx config file:
server {
client_max_body_size 100M;
listen 80;
server_name *.babysittingbordeaux.dev *.babysittingparis.dev
access_log /usr/local/var/log/nginx/baby-access.log;
error_log /usr/local/var/log/nginx/baby-error.log;
location / {
proxy_pass http://127.0.0.1:4000;
}
}
Code:
Atom.to_string(conn.scheme) <> "://" <> (Enum.into(conn.req_headers, %{}) |> Map.get("host")) <> conn.request_path
That example returns http://127.0.0.1:4000/, I would like to get http://www.babysittingbordeaux.dev/
I'm in development mode.
location / { proxy_pass http://127.0.0.1:4000; proxy_set_header Host $host; }- stephen_m