On This Page
- Redirect HTTP traffic to HTTPS
-
- To redirect port 80 requests to port 443:
From January 01, 2023, TOS R21-3 Classic is EOL. Technical support will be available for a limited period to customers with Extended Support agreements.
You can access the TOS products over HTTPS protocol using port 443. When you enter the address of the TOS server in a web browser without the https:// prefix, the connection fails because the TOS processes are not listening for the HTTP protocol on port 80.
To avoid this common error, you can configure your TOS server to redirect requests received on port 80 to port 443. This lets users connect to the TOS server even when they mistakenly enter the address of the server without the https:// prefix.
This configuration assumes some knowledge of Linux.
To redirect port 80 requests to port 443:
- Login to the command line interface of the TOS server.
-
To create a new
custom.conf
file and edit it with vi, enter:vi /etc/httpd/conf.d/custom.conf
-
Enter these lines in the file:
Listen <server_ip_address>:80
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REMOTE_HOST} !^127\.0\.0\.1.*$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}Change the <server_ip_address> in the
Listen
statement to the host IP or VIP (for example, if HA is configured for automatic failover) address. - Save the file.
- To restart the httpd service, enter:
systemctl restart httpd