<@U04UQ68083H> Could you please explain what is th...
# ory-copilot
r
@chilly-king-10285 Could you please explain what is the host and base_url?
Copy code
serve:
  public:
-    base_url: <http://127.0.0.1:4433/>
+    base_url: <https://accounts.example.com/>
    host: 127.0.0.1
    cors:
      enabled: true
b
A message from kapa.ai
In Ory configuration, the
host
and
base_url
parameters serve different but complementary purposes: - host: This parameter (set to
127.0.0.1
in your example) defines the network interface that Ory listens on. When set to
127.0.0.1
, Ory will only accept connections from the local machine, making it inaccessible from the public internet. This is a security measure often used in production deployments to ensure that certain endpoints (especially admin APIs) aren't publicly exposed. - base_url: This parameter defines the publicly accessible URL that will be used for generating redirect URLs, form action URLs, and other external-facing links. In your configuration, it's being changed from
<http://127.0.0.1:4433/>
to
<https://accounts.example.com/>
, which indicates a move from a local development environment to a production domain. This configuration pattern is commonly used in production deployments where you want Ory to listen only on the local interface (
host: 127.0.0.1
) while a reverse proxy like Nginx handles public-facing traffic and forwards requests to Ory internally. The
base_url
ensures all generated URLs point to your public domain. As explained in the Ory documentation for deploying to production: > We need to set
serve.public.host
and
serve.admin.host
to
127.0.0.1
to ensure Ory Kratos is listening on the loopback interface. [Deploy to production](https://www.ory.sh/docs/kratos/guides/deploy-kratos-example#run-ory-kratos-using-systemd) This setup is part of a secure deployment architecture where Nginx or another reverse proxy would be configured to forward requests from your public domain to the locally running Ory service, as shown in the Nginx configuration examples in the Ory documentation.