As described in Adding CORS support to
ESP
,
you can configure the Extensible Service Proxy
(ESP)
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:
-
Start with a
nginx.conf
file that contains the configuration required by Cloud Endpoints. You can start with the samplenginx.conf
, or if you have already deployed ESP, you can SSH to the ESP container and copy thenginx.conf
file from the/etc/nginx/endpoints/
directory. -
Add the CORS options that your application requires to
nginx.conf
. You can use the CORS on NGINX example as a starting point. -
Start ESP with the
--nginx_config
option with the path to the customnginx.conf
file.
What's next
-
Learn about ESP's startup options .
-
Learn how to SSH to ESP's container on GKE .
-
Learn about using a custom nginx.conf on GKE .