# 75.10 在前端代理服务器后运行

你的应用可能需要发送`302`跳转或使用指向自己的绝对路径渲染内容。当在代理服务器后面运行时，调用者需要的是代理服务器链接而不是部署应用的实际物理机器地址，通常的解决方式是代理服务器将前端地址放到headers并告诉后端服务器如何拼装链接。

如果代理添加约定的`X-Forwarded-For`和`X-Forwarded-Proto` headers（大多数代理服务器会这样做），只要将`application.properties`中的`server.use-forward-headers`设置为`true`，绝对链接就能正确的渲染。

**注** 如果应用运行在Cloud Foundry或Heroku，`server.use-forward-headers`属性默认为`true`。其他实例默认为`false`。


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jack80342.gitbook.io/spring-boot/ix.-how-to-guides/75.-embedded-web-servers/75.10-running-behind-a-front-end-proxy-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
