Quick questions regarding templates

fullshop

Verified User
Joined
Jun 30, 2010
Messages
12
Hello,
I'm trying to customize my nginx_server_secure.conf custom file and seems that if I'm inserting an if in if statement is not working.

For example the syntax in bold is not validated, only that my endif is closing the HAVE_NGIX_PROXY value:

Code:
|*if HAVE_NGINX_PROXY="1"|
        location /
        {
|CUSTOM2|
|LOCATION_INSERT|
                # access_log off;
                proxy_buffering |PROXY_BUFFERING|;
                proxy_pass [url]https://|IP|:|PORT_8081|;[/url]
                proxy_set_header X-Client-IP	  $remote_addr;
                proxy_set_header X-Accel-Internal /nginx_static_files;
                proxy_set_header Host             $host;
                proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
                proxy_hide_header Upgrade;

[B]|*if DOMAIN="domain.tld"|
                proxy_set_header Accept-Encoding "";
|*endif|[/B]
        }
	location /nginx_static_files/
        {
                # access_log  /var/log/nginx/access_log_proxy;
                alias       |DOCROOT|/;
                internal;
        }
|*else|
Any advice on this one?

Thanks
 
Hello,

Directadmin does not support IF-statements within another IF-statements. Try something like this:

Code:
[B]|*if DOMAIN="domain.tld"|
|?CUSTOM_ACCEPT_ENCODING=proxy_set_header Accept-Encoding "";|
else
|?CUSTOM_ACCEPT_ENCODING=|
|*endif|[/B]

|*if HAVE_NGINX_PROXY="1"|
        location /
        {
|CUSTOM2|
|LOCATION_INSERT|
                # access_log off;
                proxy_buffering |PROXY_BUFFERING|;
                proxy_pass [URL="https://%7Cip%7C:|PORT_8081|;/"]https://|IP|:|PORT_8081|;[/URL]
                proxy_set_header X-Client-IP      $remote_addr;
                proxy_set_header X-Accel-Internal /nginx_static_files;
                proxy_set_header Host             $host;
                proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
                proxy_hide_header Upgrade;
                [B]|CUSTOM_ACCEPT_ENCODING|[/B]
        }
    location /nginx_static_files/
        {                # access_log  /var/log/nginx/access_log_proxy;
                alias       |DOCROOT|/;
                internal;
        }
|*else|
 
Back
Top