Nginx domain/user rewrites

MtK

Verified User
Joined
Aug 2, 2007
Messages
412
Hey,
we all know, nginx is far more tricky than apache, when it comes to write rules, even on those CMSs that we all know how to rewrite.

the problem here is that each domain/subdomain/subdirectory would need it's own set of rules set in the corresponding (user's / domain's) nginx.conf to function properly (or at all).

but what would happen when a sysadmin would need a rewrite_confs? because of either a faulty setting, or even performance improvement.
all those specific domain/user nginx rules will be overwritten.
we also cannot expect all the users on the server to write their own rewrite rules to replace their .htaccess, but that's a different issue.


so, maybe as partially suggested here, the Custom HTTPD Configurations should be renamed to something more general (because HTTPD is not necessarily used) and there have the user/domain specifics, which will not be rewritten.
maybe even add an additional:
Code:
include /usr/local/directadmin/data/users/|USER|/nginx-|DOMAIN|.conf
to the user's nginx.conf template.
 
oh!
it already does that!!!! :cool:


but maybe we do need to change that confusing HTTPD...
 
oh!
it already does that!!!! :cool:


but maybe we do need to change that confusing HTTPD...
OK, taking half of it back.
the Custom Config is partially working:
  1. the user cannot edit it, only admins
  2. is shows as "Contents of the nginx.conf file for DOMAIN.COM, but contains settings for all the user's domain.
    seems like the nginx.conf is edited directly.

so my suggestion is to add:
Code:
include /usr/local/directadmin/data/users/|USER|/nginx/*.conf (or similar)
to the /usr/local/directadmin/data/users/|USER|/nginx.conf template.

and then have:
Code:
include /usr/local/directadmin/data/users/|USER|/nginx/|DOMAIN|.conf
for each domain.


I've added a directory structure, to be consistant with the FPM structure.
Speaking of FPM, maybe a similar "edit" option should be added for each domain.
 
Last edited:
let's add to this:
Code:
                       fastcgi_pass unix:/usr/local/php55/sockets/webapps.sock;
not being replaced as well
 
Back
Top