1. Home
  2. vDDoS Proxy Protection
  3. Custom Redirect URL & Location Block

Custom Redirect URL & Location Block

Sometimes you want to customize the 301 redirect for domains as you want, you can configure this in the redirect.conf file:

Note: This configuration will affect all domains in vDDoS

Redirect HTTP to HTTPS:

1. Edit redirect.conf:

nano /vddos/conf.d/redirect.conf

set $schemedomain "${scheme}://${host}"; # Please Do not remove this line!


#############################################################################################
############## Redirect NON-SSL to SSL for your domain: 
############## (http://your-domain.com to HTTPS://your-domain.com)
if ($schemedomain = "http://your-domain.com") {
    return 301 https://your-domain.com$request_uri;
}

2. Restart vDDoS after configuration:

vddos restart


Redirect WWW to NON-WWW:

1. Edit redirect.conf:

nano /vddos/conf.d/redirect.conf

#############################################################################################
############## Redirect WWW to NON-WWW for your domain: 
############## (http://WWW.your-domain.com to http://your-domain.com)
if ($schemedomain = "http://www.your-domain.com") {
    return 301 http://your-domain.com$request_uri;
}

2. Restart vDDoS after configuration:

vddos restart


Redirect DOMAIN to OTHER-DOMAIN:

1. Edit redirect.conf:

nano /vddos/conf.d/redirect.conf

#############################################################################################
############## Redirect DOMAIN to OTHER-DOMAIN for your domain: 
############## (http://your-domain.COM to http://your-domain.ORG)
if ($schemedomain = "http://www.your-domain.com") {
    return 301 http://your-domain.org$request_uri;
}

2. Restart vDDoS after configuration:

vddos restart


Not challenge for a directory:

1. Edit redirect.conf:

nano /vddos/conf.d/redirect.conf

#############################################################################################
############## NON-Security for whitelist directories of your domain: 
############## (NON-Security for http://your-domain.com/secret/folder)
location /secret/folder {
	proxy_set_header   Host             $host;
	proxy_set_header   X-Real-IP        $remote_addr;
	proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
   proxy_pass      http://7.13.44.13:80;
}

2. Restart vDDoS after configuration:

vddos restart

Articles

Was this article helpful to you? Yes No