> For the complete documentation index, see [llms.txt](https://docs.verygoodsecurity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verygoodsecurity.com/vault/http-proxy/identifying-upstream-status-codes.md). Agents can also search and read this documentation through its [MCP server](https://docs.verygoodsecurity.com/~gitbook/mcp).

# Identifying Upstream Status Codes

When perform an HTTPS request using the VGS HTTPS Proxy, VGS will always attempt to forward the status code that it receives from the upstream server. That said, it is hypothetically possible that the VGS system can provide a different response code than what was returned from the third-party.

In order to verify that the upstream server and VGS are returning the same response codes, VGS appends a "VGS-Upstream-Status-Code" header to the HTTP response. This value contains the exact response code that VGS received from the upstream service and should always match the actual HTTP response status code.

The following is a diagram showcasing how the status code is used during an HTTPS request through the VGS proxy.

<figure><img src="https://2096104711-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUreALQAfVnRMQEz110rC%2Fuploads%2FLNj2nz9PdEkLgV7AFulm%2Fimage.png?alt=media&amp;token=a0313c66-e2fc-4753-bfe3-35a6ccae3599" alt=""><figcaption></figcaption></figure>

### Sample Response

Below is an example of an HTTPS request that is proxied through the VGS Outbound Route. The response shows both the "200" response from VGS, and the VGS-Upstream-Status-Code of "200" that VGS received from the upstream.

```shellscript
curl -i https://echo.sandbox.verygoodvault.com/post --cacert sandbox.pem \
  -x https://$VGS_USERNAME:@VGS_PASSWORD@tntsfeqzp4a.sandbox.verygoodproxy.com:8443  
  
HTTP/1.1 200 Connection established
Connection: keep-alive
Via: 1.1 proxy

HTTP/1.1 200 OK
Date: Tue, 13 Jan 2026 06:28:17 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, PATCH
content-length: 0
VGS-Upstream-Status-Code: 200
Via: 1.1 proxy
VGS-Request-Id: b7415b02f87edf0b2e89448b6dd578c5
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.verygoodsecurity.com/vault/http-proxy/identifying-upstream-status-codes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
