Skip to main content

ory proxy local

ory proxy local#

Develop an application locally and integrate it with Ory


This command starts a reverse proxy which can be deployed in front of your application. This works best on local (your computer) environments, for example when developing a React, NodeJS, Java, PHP app.

To require login before accessing paths in your application, use the --protect-path-prefix flag:

$ ory local proxy --port 4000 http://localhost:3000 --protect-path-prefix /members --protect-path-prefix /admin

The --protect-path-prefix flag is currently using a string prefix match. Future versions will include support for regular expressions and glob matching.

If the request is authenticated, a JSON Web Token will be sent in the HTTP Authorization Header containing the Ory Session:

GET / HTTP/1.1
Authorization Bearer <the-json-web-token>

The JSON Web Token claims contain:

  • The "sub" field which is set to the Ory Identity ID.
  • The "session" field which contains the full Ory Session.

The JSON Web Token is signed using the ES256 algorithm. The public key can be found by fetching the /.ory/jwks.json path when calling the proxy - for example

An example payload of the JSON Web Token is:

"id": "821f5a53-a0b3-41fa-9c62-764560fa4406",
"active": true,
"expires_at": "2021-02-25T09:25:37.929792Z",
"authenticated_at": "2021-02-24T09:25:37.931774Z",
"issued_at": "2021-02-24T09:25:37.929813Z",
"identity": {
"id": "18aafd3e-b00c-4b19-81c8-351e38705126",
"schema_id": "default",
"schema_url": "",
"traits": {
"email": "foo@bar",
// ... your other identity traits
ory proxy local [upstream] [flags]


--api-endpoint string Use a different endpoint. (default "")
--console-url string Use a different URL. (default "")
--dont-install-cert If set will not try to add the HTTPS certificate to your certificate store.
-h, --help help for local
--no-open Do not open the browser when the proxy starts.
--port int The port the proxy should listen on. (default 4000)
--protect-path-prefix strings Require authentication before accessing these paths.


  • ory proxy - Easily protect applications with the Ory Proxy
Last updated on by aeneasr