Community Aliases

Aliases to your community can be helpful if there is a need to load the community in multiple places, or if the community needs to be loaded in a “subfolder” on the domain instead of a subdomain. (IE: http://www.example.com/community)

Examples

The aliases can be setup with any reverse proxy by passing the headers “X-One-Node-Alias” and “Host”. Host refers to domain of the community, for example: community.example.com. X-One-Node-Alias is a combination to replace in the page’s DOM. For instance, if the reverse proxy lives on example.com/community, pass in community=example.com to replace all urls to community.example.com with example.com/community.

Curl

Varnish

The following is an example implementation with Varnish. Depending on the needs of your project, your implementation may differ.

Headers

The ONEsite system relys on serveral headers from the being passed into the request. The reverse proxy system implemented should pass through the following headers without modification: X-Requested-With, User-Agent, Cookie, and Referer.

Host

The “Host” parameter should be the community’s domain in our database. For example: “community.example.com”. This string can be hardcoded into the application.

X-ONE-Node-Alias

The X-One-Node-Alias is a combination of the url where the reverse proxy lives seperated by an equal sign. An example value, where the reverse proxy is at “example.com/community” is “community=example.com”.

X-One-Cookie-Domain

X-One-Cookie-Domain refers to the domain where the cookies should be set. For a reverse proxy living on “example.com/community” pass in “.example.com”. In most instances, this variable can be hard coded.

X-Forwarded-For

X-Forwarded-For refers to the user’s IP address. This allows the system to capture the user’s actual IP address instead of your server’s IP Address. In PHP, this equates to the value “$_SERVER[‘REMOTE_ADDR’]”.