Custom settings in nginx Directives field won't apply

Discussion in 'Installation/Configuration' started by mike.smith, Apr 25, 2023.

  1. mike.smith

    mike.smith New Member

    I use ISPConfig 3 with Nginx as a reverse proxy. when I put some settings in "Proxy Directives" field and save it, they are applied but when I put them in "nginx Directives" field and save it, they aren't applied. why is it so?
     
  2. mike.smith

    mike.smith New Member

    when I put custom settings in "Proxy Directives" field, it saves in "location / {}" block in nginx .vhost file. but I want to save it in server{} block. What should I do?
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Put it in the nginx directives field. If it is not saved, you know your directives were invalid, and Nginx could not start with your custom configuration. In this case, the last working config is used and the non-working config is saved with .err file ending in the nginx sites-available folder.
     
  4. mike.smith

    mike.smith New Member

    my directives are valid and when I put it directly in .vhost file and restart nginx, every thing is good and there is no problem.
    for example when I put the following directive in nginx Directives field, ispconfig doesn't save it and there is not any .err file.

    location ~* \.(eot|svg|ttf|woff|woff2)$ {
    expires 60m;
    }

    what I noticed is that, when I changed the Redirect Type to proxy, content in nginx Directives field not saved but about other options in Redirect Type, content is saved.
     
  5. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    This is not valid. And duplicate location is not valid too.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    When you do a proxy redirect, options in the nginx field do not matter and are discarded, as it means that all traffic is proxied to another website via proxy. If you want to use custom nginx directives, do not enable proxy and then put your directives in the custom nginx directives field, these custom directives may also contain proxy directives in case you want to set up a custom proxy which does not match the default settings from ISPConfig.
     
    ahrasis likes this.
  7. mike.smith

    mike.smith New Member

    Thank you Till for your help
    I changed "Redirect Type" to "No redirect" and put my proxy rules and custom nginx directives to nginx directives field and my problem was solved.
     
    Last edited: Apr 30, 2023

Share This Page