How to use proxy functionality in ISPConfig

Discussion in 'General' started by fazelukario, Oct 31, 2024.

  1. fazelukario

    fazelukario Member

    I found this in the `nginx_vhost.conf.master` template:

    Code:
    <tmpl_if name='use_proxy'>
            ## no proxy for acme-challenge
            location ^~ /.well-known/acme-challenge/ {
                access_log off;
                log_not_found off;
                root /usr/local/ispconfig/interface/acme/;
                autoindex off;
                index index.html;
                try_files $uri $uri/ =404;
            }
    
            location / {
                proxy_pass <tmpl_var name='rewrite_target'>;
                <tmpl_if name='rewrite_subdir'>rewrite ^/<tmpl_var name='rewrite_subdir'>(.*) /$1;</tmpl_if>
    <tmpl_loop name="proxy_directives">
            <tmpl_var name='proxy_directive'>
    </tmpl_loop>
            }
    </tmpl_if>
    How to use it, and especially where to fill in the `proxy_directives`
     
  2. fazelukario

    fazelukario Member

    Ok, I figured it out myself, but how do I not include this line in the final configuration?

    Code:
    <tmpl_if name='rewrite_subdir'>rewrite ^/<tmpl_var name='rewrite_subdir'>(.*) /$1;</tmpl_if>
     
  3. fazelukario

    fazelukario Member

    @till So how can I disable of adding this string to final configuration?
     
  4. remkoh

    remkoh Active Member HowtoForge Supporter

    Copy file /usr/local/ispconfig/server/conf/nginx_vhost.conf.master to /usr/local/ispconfig/server/conf-custom/nginx_vhost.conf.master and customize that file according to your needs.

    So in your case delete the line that you do not want in there.

    That way your customizations don't get overwritten when updating ISPC.
     
  5. fazelukario

    fazelukario Member

    I know about overriding configs, I ask about "Is there a button or checkmark to not include this line on per website basis?".
     
  6. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Since it is defaulted in location, you should be able to remove them all and add your version via directives.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    What exactly did you enter as the proxy target? This line gets added only if you have set a path that is not / as proxy target path.
     
    ahrasis likes this.

Share This Page