> This page is for Applications Protection.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.humansecurity.com/llms.txt.

# First Party Configuration

In First Party Mode, the NGINX C-Core module acts as a reverse proxy for client requests and sensor activity.

The NGINX C-Core module is configured with First-Party mode enabled by default.

To confirm that you have configured your NGINX C-Core module in First-Party mode, review the server block in your Nginx configuration that contains the necessary details.

## First Party Enabled Example (default value)

The following example shows a basic `nginx.conf` configuration file for the NGINX C-Core module:

```shell
worker_processes  1;
error_log /var/log/nginx/error.log debug;
events {
    worker_connections 1024;
}

http {
    real_ip_header X-Forwarded-For;
    resolver 8.8.8.8;

    server {
        listen 80;
        listen [::]:80;

        px_enabled true;
        px_appId "<PX_APP_ID>";
        px_auth_token "<PX_AUTH_TOKEN>";
        px_cookie_secret "<COOKIE_ENCRYPTION_KEY>";

        location / {
            root   /nginx/www;
            index  index.html;
            include  /nginx/conf/mime.types;
        }
    }
}
```

* If *px_first_party_enabled* is not found in the server block, the First-Party Mode is enabled in the Enforcer. (Continue to the [Next Steps](/applications/nginx-c-module-first-party-config#next-steps) below.
* Otherwise, proceed to the [First Party Mode Disabled Example](/applications/nginx-c-module-first-party-config#first-party-mode-disabled-example).

## First Party Mode Disabled Example

Below is an example of a basic nginx.conf configuration file for the NGINX C-Core module.

> The presence of the *px_first_party_enabled* with a value of false confirms that the default configuration has been changed and First-Party mode is disabled.

```shell
worker_processes  1;
error_log /var/log/nginx/error.log debug;
events {
    worker_connections 1024;
}

http {
    real_ip_header X-Forwarded-For;
    resolver 8.8.8.8;

    server {
        listen 80;
        listen [::]:80;

        px_enabled true;
        px_appId "<PX_APP_ID>";
        px_auth_token "<PX_AUTH_TOKEN>";
        px_cookie_secret "<COOKIE_ENCRYPTION_KEY>";
        px_first_party_enabled false;

        location / {
            root   /nginx/www;
            index  index.html;
            include  /nginx/conf/mime.types;
        }
    }
}
```

In order to enable First Party Mode, you need to set the *px_first_party_enabled* to `true` and reload your NGINX configuration and continue to the [Next Steps](/applications/nginx-c-module-first-party-config#next-steps) below.

## Next Steps

After configuring the enforcer to handle First Party requests, complete the steps listed on the [Integrate 1st-Party JS Snippet](/applications/integrate-1st-party-client) to confirm your snippet is setup to serve the Javascript Sensor via First-Party.