Target Proxies

Target proxies are referenced by one or more global forwarding rules. In the case of HTTP(S) load balancing, proxies route incoming requests to a URL map. In the case of SSL proxy and TCP proxy load balancing, target proxies route incoming requests directly to backend services.

Target proxy properties

See the TargetHttpProxies, TargetHttpsProxies, TargetSslProxies, and TargetTcpProxies resource for descriptions of the properties and methods available to you when working with target proxies through either the REST API or the gcloud command-line tool.

Add a target proxy

To add a target proxy using the gcloud command-line tool, use one of the following commands:

HTTP

gcloud compute target-http-proxies create [HTTP_PROXY] \
  --url-map URL_MAP [--description [DESCRIPTION]]

HTTPS

HTTPS load balancing supports creating a target HTTPS proxy that has up to 10 SSL certificates. Before you run this command, you must create an SSL certificate resource for each certificate.

 gcloud alpha compute target-https-proxies create [HTTPS_PROXY] \
   --url-map URL_MAP \
   --ssl-certificates [SSL_CERT_1][,[SSL_CERT_2],...]

To create a target proxy through the API, send a POST request to:

HTTP

POST https://www.googleapis.com/v1/compute/projects/PROJECT_ID/global/targetHttpProxies

{
  "name": [PROXY_NAME],
  "urlMap": [URL_MAP]
}

HTTPS

POST https://www.googleapis.com/v1/compute/projects/[PROJECT_ID]/global/targetHttpsProxies

{
  "name": [PROXY_NAME],
  "urlMap": [URL_MAP],
  "sslCertificates": [SSL_CERT_1][,[SSL_CERT_2],...]
}

List target proxies

To list target proxies using the gcloud command-line tool, use the following command:

HTTP

gcloud compute target-http-proxies list

HTTPS

gcloud compute target-https-proxies list

In the API, send an empty GET request to the following URI:

HTTP

https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/global/targetHttpProxies

HTTPS

https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/global/targetHttpsProxies

Get a target proxy

To get information about a single target proxy using the gcloud command-line tool, use the following command:

HTTP

gcloud compute target-http-proxies describe [PROXY_NAME]

HTTPS

gcloud compute target-https-proxies describe [PROXY_NAME]

In the API, send an empty GET request to the following URI:

HTTP

https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/targetHttpProxies/[PROXY_NAME]

HTTPS

https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/targetHttpsProxies/[PROXY_NAME]

Delete a target proxy

To delete a target proxy, you must first delete any global forwarding rules that reference it.

To delete a target proxy using the gcloud command-line tool, use the following command:

HTTP

gcloud compute target-http-proxies delete [PROXY_NAME]

HTTPS

gcloud compute target-https-proxies delete [PROXY_NAME]

In the API, send an empty DELETE request to the following URI:

HTTP

https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/global/targetHttpProxies/[PROXY_NAME]

HTTPS

https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/global/targetHttpsProxies/[PROXY_NAME]

Update a URL map for the target proxy

To update the URL map associated with a target proxy with the gcloud command-line tool, use the following command:

HTTP

gcloud compute target-http-proxies update [PROXY_NAME] \
   --url-map [URL_MAP]

HTTPS

gcloud compute target-https-proxies update [PROXY_NAME] \
   --url-map [URL_MAP]

In the API, send a POST request to the following URI, passing the fully-qualified URI to the URL maps to add or remove in the request body:

HTTP

POST https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/global/targetHttpProxies/[PROXY_NAME]/setUrlMap

{
  "urlMap": [URL_MAP]
}

HTTPS

POST https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/global/targetHttpsProxies/[PROXY_NAME]/setUrlMap

{
  "urlMap": [URL_MAP]
}

Update the SSL certificate resource for an HTTPS target proxy

Because HTTP proxies do not use SSL certificates, these instructions only apply to HTTPS proxies.

To update the SSL certificate resources associated with an HTTPS target proxy using the gcloud command-line tool, use the following command, in which you can specify up to 10 SSL certificate resources:

HTTPS

   gcloud compute target-https-proxies set-ssl-certificates [PROXY_NAME] \
        --ssl-certificates [SSL_CERT_1][,[SSL_CERT_2],...]

In the API, send a POST request to the following URI, passing the fully-qualified URI of the SSL certificate resources to add or remove in the request body:

HTTPS

POST https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/global/targetHttpsProxies/[PROXY_NAME]/setSslCertificates

{
  "sslCertificates": [ SSL_CERT_1][,[SSL_CERT_2],... ]

}

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Compute Engine Documentation