Apache: configure for reverse proxy
An Apache reverse proxy configuration allows you to get the URL used by the GAS when a reverse proxy server is used.
Simplifying the configuration
In your network configuration for reverse proxy it is recommended to use the same URI
(for example, /gas
) for the reverse proxy as the backends where the GAS is running.
This means that you will not need to do any further configuration than what is outlined
in the steps in this task.
ProxyFCGISetEnvIf "true" SCRIPT_NAME "/main"
This directs the Apache web server to build URLs with the /main URI instead of the /backend URI.
When the GAS sits behind a proxy, the Apache reverse proxy
configuration ensures the GAS
URLs are reachable provided the following X-Forwarded
headers are available: X-Forwarded-Proto should contain HTTP or HTTPS, X-Forwarded-Host should contain
host:port, and X-Forwarded-Prefix should contain the PathBase
(/path/base) of the URI.
The GAS will automatically use these header values (if present) to build the URL used by the client.
In this task, you
configure Apache for the X-Forwarded
headers. For more information on forwarded
HTTP headers, see rfc7239.