As described in [Adding CORS support to
ESP](https://docs.cloud.google.com/endpoints/docs/openapi/specify-proxy-startup-options#adding_cors_support_to_esp),
you can configure the [Extensible Service Proxy
(ESP)](https://docs.cloud.google.com/endpoints/docs/openapi/glossary#extensible_service_proxy) to support CORS.
If the ESP options don't provide the CORS support that your
application requires, you can add the CORS options to ESP's configuration file,
`nginx.conf`.

## Adding the CORS options to `nginx.conf`

To add the CORS options:

1. Start with a `nginx.conf` file that contains the configuration required by
   Cloud Endpoints. You can start with the [sample
   `nginx.conf`](https://github.com/GoogleCloudPlatform/endpoints-samples/blob/master/k8s/nginx.conf),
   or if you have already deployed ESP, you can SSH to the ESP container and
   copy the `nginx.conf` file from the `/etc/nginx/endpoints/` directory.

2. Add the CORS options that your application requires to `nginx.conf`. You can
   use the [CORS on NGINX](https://enable-cors.org/server_nginx.html) example
   as a starting point.

3. Start ESP with the `--nginx_config` option with the path to the custom
   `nginx.conf` file.

## What's next

- Learn about [ESP's startup options](https://docs.cloud.google.com/endpoints/docs/openapi/specify-proxy-startup-options.md.txt).

- Learn how to [SSH to ESP's container on GKE](https://docs.cloud.google.com/endpoints/docs/openapi/troubleshoot-gke-deployment.md.txt#checking_configuration_files).

- Learn about [using a custom nginx.conf on GKE](https://docs.cloud.google.com/endpoints/docs/openapi/custom-nginx.md.txt).