Skip to content

Commit 54e3a97

Browse files
committed
allow binding to a unix domain socket
1 parent cb57616 commit 54e3a97

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

config/runtime.exs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ http_port =
6969

7070
https_port = get_int_from_path_or_env(config_dir, "HTTPS_PORT")
7171

72+
http_uds = get_var_from_path_or_env(config_dir, "HTTPS_UDS")
73+
7274
base_url = get_var_from_path_or_env(config_dir, "BASE_URL")
7375

7476
if !base_url do
@@ -330,6 +332,12 @@ config :plausible, PlausibleWeb.Endpoint,
330332
websocket_url: websocket_url,
331333
secure_cookie: secure_cookie
332334

335+
if http_uds do
336+
uds_bind = [ip: {:local, http_uds}, port: 0]
337+
uds_opts = Config.Reader.merge(default_http_opts, uds_bind)
338+
config :plausible, PlausibleWeb.Endpoint, http: uds_opts
339+
end
340+
333341
# maybe enable HTTPS in CE
334342
if config_env() in [:ce, :ce_dev, :ce_test] do
335343
if https_port do

0 commit comments

Comments
 (0)