Nginx settings lost frequently

izzie

Verified User
Joined
Dec 16, 2020
Messages
7
I'm struggling with Nginx configuration in DirectAdmin.

When I use the custom httpd config templates it does not save the changes, using template 2.

When I manually paste the following fix:

location / { try_files $uri $uri/ /index.php?q=$uri&$args; }

It works for a while but every day it gets lost.

It's really a nightmare because the fix is only valid for a day at most.

Can anyone point me out how to implement the fix so that I don't have to apply it every day?

Thank you in advance.
 
What files exactly (locations) are you changing? If you edit the normal templates they are overwritten with updates
 
and you are talking about CutomHttpd in DA giu, or about:
/usr/local/directadmin/data/templates/custom/nginx_server.conf and others?
 
/usr/local/directadmin/data/users/usernames/nginx.conf

Where should I write to keep the changes?
 
when you try to save - scroll to down and you will see if there are errors, if errors there - maybe you are setting something wrong.
Maybe you are clicking on domain name, not on nginx_proxy - so in such case you are configuring Apache, not nginx. For nginx - click on nginx_proxy
in my screen it's nginx_apache config
 

Attachments

  • 21-04-2022 15-39-13.jpg
    21-04-2022 15-39-13.jpg
    61.1 KB · Views: 79
I'm sure I'm clicking on Nginx.conf (running Nginx without Apache) and am also saving in custom template 2 which should be right.
However it does not accept the code.

I should paste it like location / { try_files $uri $uri/ /index.php?q=$uri&$args; } right?
Or just try_files $uri $uri/ /index.php?q=$uri&$args; ?
 
CUSTOM2
Appears in ALL location / sections. Use the LOCATION token.

I understand if I read this that it should be the first variant right?
 
Might it be better to just put it in the upper area instead of custom sections?
Saw somebody on YouTube do that.


nginx.conf customization for domain.com

 
you can use any you want, it's just to make life easier you you don't want to write rules where to put it - you can just put to custom 1-4 sections with predefined places in templates.
 
Back
Top