Edit domain's NGINX.conf

rocky123xo

Verified User
Joined
Nov 6, 2020
Messages
8
Trying to make the following change for a domain, and having trouble. Tokens don't work, because I need to direct both port 80 and 443 to https.
#proxy_pass http://xx.xx.xx.xxx:8080; << OLD
proxy_pass https://192.168.1.21:444; << NEW

Pasting the entire server block into custom just stacks it on top of the existing config and breaks NGINX. Can anyone shed light on what I'm doing wrong?
 
#proxy_pass http://xx.xx.xx.xxx:8080; << OLD
That is in the Non Secure template. Separate templates for 80 and 443

nginx_server.conf

you need to be in the secure template

nginx_server_secure.conf

read here

If you are using nginix_apache in options.conf

You cant edit the main templates you have to copy them and edit them in "custom" directory.

Then run ./build rewrite_conf

Not sure why you need to change the port s though. It works fine the standard way
 
to force ssl go to USER
Dashboard / Domain management / Modify Domain

Check Force SSL with https redirect
 
Last edited:
What I'm trying to do is proxy traffic to that domain to an internal IP and port. Like if I were using Traefik.
I can edit these NGINX templates to achieve that (I think) but these look like they're global.
Is "/usr/local/directadmin/data/templates/custom/" somehow per-domain?

Thanks.
 
In general, they are global. Standardized for Standard hosting. You have to customize them if you want something custom.
Like if you wanted webmail.domain.com vs domain.com/webmail
you would sort of follow this.
Is "/usr/local/directadmin/data/templates/custom/" somehow per-domain?
No.
You use the template variable with if-then statements

the Nginx guide points
to the apache guide
This has the variables listed
 
I appreciate you trying to explain it to me, but I don't feel like I'm getting closer to my answer here.
I understand exactly what I have to do and could do it if it were a regular NGINX deployment.
But with DA, I'm unable to directly edit nginx.conf. So I'm wondering where I need to make my changes (namely the entire proxy_pass section).
 
I appreciate you trying to explain it to me, but I don't feel like I'm getting closer to my answer here.
I understand exactly what I have to do and could do it if it were a regular NGINX deployment.
But with DA, I'm unable to directly edit nginx.conf. So I'm wondering where I need to make my changes (namely the entire proxy_pass section).
I would hire someone then or you can see if others can help you if maybe they have done something similar.
 
No worries, I appreciate the help! Figured it was outside the normal scope of DA.
 
Back
Top