Skip to main content

Domain Specific Rewrite Rules

Add Nginx rewrite rules for domains

 You can include custom rewrite rules as follows:

If your domain name is foo.com, see below to add a rewrite rule

  • For HTTP domain: Create a file /usr/local/nginx/conf/vhost.d/foo.com.rewrite
  • For HTTPS domain: create a file /usr/local/nginx/conf/vhost.ssl.d/foo.com.rewrite

After that, rebuild the vhost configuration using nginxctl as follows

nginxctl rebuildvhost  foo.com

This option is only available for server administrations. Cpnginx will add a WHM interface to add or edit custom nginx rewrite rules.