Note
This dashboard section can be accessed only by users with Technical role.
In this dashboard section, you can manage the rules guiding how reverse HTTP proxy redirects part of a user's HTTP requests.
For details, see Technologies: HTTP redirects.
View list of rules
To see the list of rules configured for a particular domain:
-
In the Domains section of the dashboard, select the particular domain.
-
Select HTTP redirects.
The rules are displayed in a table with the following columns:
-
Request - URL pattern for which this rule applies.
If the rule uses a specific host, then the request in this column is displayed in the format
<protocol>://<host>
, e.g.http://example.com
.If the rule should work for any host, the
ANY
value is displayed instead of the host, e.g.http://ANY
. -
Redirect — HTTP response code, as well as URL to which the redirect is made.
The response code and URL are displayed on the same line separated by a space, e.g.
301 http://example.com/
.If the Transmit as is options were enabled for some request components (see Add rule, the string will be displayed with special variables whose values will be substituted when processing each specific request:
$hostname
- Host from user's request,$path
- Path from user's request,$args
- GET arguments from user's request.
For example:
301 http://$hostname$path?$args
.If redirection is disabled within this rule, this column will show Disabled.
Add rule
-
In the Domains section of the dashboard, select the particular domain.
-
Select HTTP redirects.
-
Click Add.
-
In the Request section, specify the request parameters for which the rule will be triggered.
-
Scheme — request protocol (HTTP or HTTPS).
-
Hostname — the domain name to which the request is made. If the
FQDN
option is selected, then in the text field below you must enter a specific domain name for which the requests will be checked. If theANY
option is selected, the rule will not depend on the domain name in the request.
-
-
In the Redirect section, specify the actions that the reverse HTTP proxy should perform over the request.
-
Enabled - enable request processing. If this option is disabled, requests will be sent to upstream without any changes.
-
Scheme - request protocol (HTTP or HTTPS).
-
Response code - HTTP response code with which the user will be redirected. You can choose from the following codes:
- 301 Moved Permanently
- 302 Found
- 307 Temporary Redirect
- 308 Permanent Redirect
-
Hostname — the domain name that will be used in the URL for redirection.
To use the domain name from the original request unchanged each time, set the Transmit as is option.
-
Path — the path that will be used in URL redirection.
To use the path from the original request unchanged each time, set the Transmit as is option.
-
Request parameters — whether to use GET parameters from the original request.
To use GET parameters from the original request unchanged each time, set the Transmit as is option. If the option is not set, all GET parameters will be removed from the request.
-
-
Click Save.
-
To save your changes, click Save in the notification at the bottom of the screen.
Edit rule
-
In the Domains section of the dashboard, select the particular domain.
-
Select HTTP redirects.
-
Next to the rule you want to edit, click Edit.
-
Make the necessary changes to the rule.
Fields in the rule editing form are identical to the fields in the add rule form.
-
Click Save.
-
To save your changes, click Save in the notification at the bottom of the screen.
Delete rule
-
In the Domains section of the dashboard, select the particular domain.
-
Select HTTP redirects.
-
Next to the rule you want to edit, click Delete.
-
Confirm the action by clicking Delete in the dialog box that appears.
-
To save your changes, click Save in the notification at the bottom of the screen.
Configuration example
In the above example, the reverse HTTP proxy is used to protect a site using the example.com
host and its subdomains. It is assumed that all sections of the site, except for the section on the old.example.com
subdomain, support HTTPS.
The reverse HTTP proxy will execute the rules as follows:
-
When working with HTTP:
- In requests to
example.com
, the protocol is replaced by HTTPS and the domain is replaced bywww.example.com
with the path and arguments preserved (rule 2). - Requests to
old.example.com
are sent to the upstream unchanged (rule 4). - In other requests, the protocol is replaced by HTTPS, keeping the domain, path and arguments (rule 1).
- In requests to
-
When working with HTTPS:
- In requests to
example.com
, the domain is replaced bywww.example.com
with the path and arguments preserved (rule 3). - Other requests are sent to the upstream unchanged (implicit rule by default).
- In requests to
Note
Other redirect configuration examples for typical scenarios can be found in Examples in Technologies: HTTP redirects
.