nginx_redirect.conf template not to add location / for blank REDIRECT_PATH

Version 1.51


Changed the template to exclude the "location / {}" wrap around the rewrite, in the case that the REDIRECT_PATH is blank. It's not required, since a location / redirect applies to the whole server{} anyway, and this also prevents duplcate location / sections. Template now looks like: |*if REDIRECT_PATH=""| |CUSTOM2| rewrite ^/.*$ |REDIRECT_TO| |REDIRECT_TYPE|; |*else| location |REDIRECT_PATH|/ { |CUSTOM2| rewrite ^/.*$ |REDIRECT_TO| |REDIRECT_TYPE|; } |*endif|

Interested to try DirectAdmin? Get a 30-day Free Trial!