> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/self-managed-enterprise-edition/use-self-managed-enterprise-edition/advanced-configuration/use-ingress-controller-overrides.md).

# Configure and customize Ingress and NGINX Controller using Overrides

This guide explains how to configure Ingress resources and the NGINX controller in your Harness deployment, including how to customize its behavior using overrides.

For more information, go to [Ingress Controllers](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/) in the Kubernetes documentation.

### Ingress Configuration <a href="#ingress-configuration" id="ingress-configuration"></a>

#### Enable Ingress <a href="#enable-ingress" id="enable-ingress"></a>

```yaml
global:
  ingress:
    enabled: true
    className: "harness"  # Specifies the Ingress controller class
```

#### Host Configuration <a href="#host-configuration" id="host-configuration"></a>

```yaml
global:
  ingress:
    hosts:
      - 'myhost.example.com'  # Replace with your domain
```

#### TLS Configuration <a href="#tls-configuration" id="tls-configuration"></a>

```yaml
global:
  ingress:
    tls:
      - secretName: my-tls-secret
        hosts:
          - myhost.example.com
```

### Advanced Configuration Options <a href="#advanced-configuration-options" id="advanced-configuration-options"></a>

#### Path Type <a href="#path-type" id="path-type"></a>

```yaml
global:
  ingress:
    pathType: ImplementationSpecific  # Other options: Prefix, Exact
```

#### Custom Annotations <a href="#custom-annotations" id="custom-annotations"></a>

```yaml
global:
  ingress:
    objects:
      annotations:
        nginx.ingress.kubernetes.io/proxy-body-size: "50m"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
```

#### Host Configuration <a href="#host-configuration" id="host-configuration"></a>

```yaml
global:
  ingress:
    disableHostInIngress: false  # Set to true to disable host rules in Ingress
```

### Example Full Configuration <a href="#example-full-configuration" id="example-full-configuration"></a>

```yaml
global:
  ingress:
    enabled: true
    className: "harness"
    objects:
      annotations:
        nginx.ingress.kubernetes.io/proxy-body-size: "50m"
        nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
    disableHostInIngress: false
    pathType: ImplementationSpecific
    hosts:
      - 'myhost.example.com'
    tls:
      - secretName: my-tls-secret
        hosts:
          - myhost.example.com
```

### Configure ingress controller arguments <a href="#configure-ingress-controller-arguments" id="configure-ingress-controller-arguments"></a>

You can configure `nginx-ingress-controller` arguments using the following overrides.

```yaml
nginx:
  controller:
    watchNamespace: ""
    updateStatus: true
    httpPort: 8080
    httpsPort: 8443
    watchIngressWithoutClass: true
    defaultSSLCertificate: ""
    configMap: ""
    defaultBackendService: ""
    publishService: ""
    electionId: ""
    controllerClass: ""
```

#### Add extra arguments <a href="#add-extra-arguments" id="add-extra-arguments"></a>

Use the following to add extra arguments.

```yaml
nginx:
  controller:
    extraCommandArgs:
      - --argument=example-argument
```

#### Create cluster roles <a href="#create-cluster-roles" id="create-cluster-roles"></a>

The following creates a `clusterRole` and `clusterRoleBindings`.

```yaml
nginx:
  clusterRole:
    create: true
```

### Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

Common issues and solutions:

1. **502 Bad Gateway**
   * Check upstream service availability
   * Verify proxy timeout settings
   * Check service name and port configuration
2. **404 Not Found**
   * Verify ingress path configuration
   * Check rewrite-target annotation if used
   * Confirm service endpoint existence
   * Check nginx controller logs for errors
3. **SSL/TLS Issues**
   * Verify TLS secret exists
   * Check certificate validity
4. **Performance Issues**
   * Increase nginx controller replicas if needed
   * Check nginx controller logs for errors
