> ## Documentation Index
> Fetch the complete documentation index at: https://auth0.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NGINX Plus

> This tutorial demonstrates how to use the nginx-openid-connect module to add authentication and authorization to your NGINX server.

This tutorial demonstrates how to use the nginx-openid-connect module to add authentication and authorization to
your NGINX server. We recommend that you log in to follow this quickstart with examples configured for your account.

###

This tutorial and seed project have been tested with the following:

* NGINX Plus R24

###

First, you need to install the `nginx-plus-module-njs` module for NGINX Plus.

Follow the dynamic module installation guide to install packages in your host OS.

For Linux distributions that use `yum` package manager, you can install the module like so:

```sh lines theme={null}
sudo yum install nginx-plus-module-njs jq
```

Once you've installed it, you need to enable it for NGINX by adding the following line near the top of your
`/etc/nginx/nginx.conf` file:

```sh lines theme={null}
load_module modules/ngx_http_js_module.so;
```

###

Clone the `nginx-openid-connect` repository. This repository comes with a template configuration.

```sh lines theme={null}
git clone https://github.com/nginxinc/nginx-openid-connect
```

###

Run the configure.sh script inside the nginx-openid-connect folder to populate the template configuration for
your Auth0 application:

```sh lines theme={null}
./configure.sh --auth_jwt_key request \
--client_id {yourClientId} \
--pkce_enable \
https://{yourDomain}/.well-known/openid-configuration
```

Next, add your [tenant’s logout URL](https://auth0.com/docs/api/authentication.md#auth0-logout) to your
`openid_connect_configuration.conf` file.

###

Add the `Accept-Encoding` header and set the value to `gzip` in your
`openid_connect.server_conf` file.

###

Copy your four configuration files to the `conf.d` folder.

```sh lines theme={null}
sudo cp openid_connect.js \ 
frontend.conf \
openid_connect_configuration.conf \
openid_connect.server_conf /etc/nginx/conf.d
```

###

In the Auth0 Dashboard:

1. Go to **Applications** > **Applications**, and then select your application from the list.
2. Switch to the **Settings** view.
3. In the **Application URIs** section, add `https://{yourDomain}/_codexch`
   to **Allowed Callback URLs**.
4. Switch to the **Credentials** view.

In the **Application Authentication** section, set **Authentication Method** to None.

###

Add additional headers from the ID token (JWT) to the upstream target in your
`/etc/nginx/conf.d/frontend.conf` file.

## Next Steps

Excellent work! If you made it this far, you should now have login, logout, and user profile information running in your application.

This concludes our quickstart tutorial, but there is so much more to explore. To learn more about what you can do with Auth0, check out:

* [Auth0 Dashboard](https://manage.auth0.com/dashboard/us/dev-gja8kxz4ndtex3rq) - Learn how to configure and manage your Auth0 tenant and applications
* [Auth0 Marketplace](https://marketplace.auth0.com/) - Discover integrations you can enable to extend Auth0’s functionality
