Problem after last update customBuild 2.0 to nginx

AriyanPayamak

Verified User
Joined
Nov 4, 2014
Messages
28
Hello Every One .

After updating custom build to the latest version.
Unfortunately, there is a problem with displaying WordPress sites.

I have done some solutions
But the problem was not solved


Error


404 Not Found

nginx


****************
my nginx_server.conf

Code:
[root@server9 custom]# nano nginx_server.conf
 nginx_server.conf

|CUSTOM1| ?DOCROOT=`HOME`/domains/`DOMAIN`/public_html| ?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/usr/local/lib/php/|
server
{
|CUSTOM|

        listen |IP|:|PORT_80|;
        |MULTI_IP|

        server_name |DOMAIN| www.|DOMAIN| |SERVER_ALIASES|;

        access_log /var/log/nginx/domains/|DOMAIN|.log;
        access_log /var/log/nginx/domains/|DOMAIN|.bytes bytes;
        error_log /var/log/nginx/domains/|DOMAIN|.error.log;


        root |DOCROOT|;

        index index.php index.html index.htm;

        |NGINX_PHP_CONF|

|*if HAVE_NGINX_PROXY="1"|
        location /
        {
|CUSTOM2|
|LOCATION_INSERT|
                # access_log off;
                proxy_buffering |PROXY_BUFFERING|;
                proxy_pass http://|IP|:|PORT_8080|;
                proxy_set_header X-Client-IP      $remote_addr;
                proxy_set_header X-Accel-Internal /nginx_static_files;
                proxy_set_header Host             $host;
                proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
                proxy_hide_header Upgrade;
        }
        location /nginx_static_files/
        {
                # access_log  /var/log/nginx/access_log_proxy;
                alias       |DOCROOT|/;
                internal;
        }
|*else|
|NGINX_REDIRECTS|
|PROTECTED_DIRECTORIES|
|EXTRA_LOCATIONS|
|*endif|

|CUSTOM3|

        include /etc/nginx/webapps.conf;
|CUSTOM4|
}

The service does not reset

[root@server9 custom]# service nginx restart
nginx: [emerg] unknown directive "?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|" in /usr/local/directadmin/data/users/admin/nginx.conf:12
nginx: configuration file /etc/nginx/nginx.conf test failed





some topic It has been studied, but I did not understand





Please help me for solve this problem .
thank you :)
 
Looks like you are using a custom template. Check it against the standard template. Maybe your custom template is based on old standard.
 
usr/local/directadmin/data/users/admin/nginx.conf

Code:
[root@server9 admin]# nano nginx.conf
  GNU nano 2.0.9                                                                  File: nginx.conf


# Auto generated nginx config file by DirectAdmin version 1.61.1
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to their website

# For global config changes that affect all Users, see this guide:
# http://help.directadmin.com/item.php?id=558
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3

?DOCROOT=`HOME`/domains/`DOMAIN`/public_html| ?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|
server
{
        listen 192.99.230.000:80;
        server_name surenaxxx.xxx www.surenaxxx.xxx ;
        access_log /var/log/nginx/domains/surenaxxx.xxx.log;
        access_log /var/log/nginx/domains/surenaxxx.xxx.bytes bytes;
        error_log /var/log/nginx/domains/surenaxxx.xxx.error.log;
        root |DOCROOT|;
        index index.php index.html index.htm;
        include /usr/local/directadmin/data/users/admin/nginx_php.conf;
        location /payment/pay-admin/
        {
                auth_basic              "pay-admin";
                auth_basic_user_file    /home/admin/domains/surenaxxx.xxx/.htpasswd/public_html/payment/pay-admin/.htpasswd;
                include /usr/local/directadmin/data/users/admin/nginx_php.conf;
        }
        include /etc/nginx/webapps.conf;
}

server
{
        listen 192.99.230.000:443 ssl http2;
        server_name surenaxxx.xxx www.surenaxxx.xxx ;
        access_log /var/log/nginx/domains/surenaxxx.xxx.log;
        access_log /var/log/nginx/domains/surenaxxx.xxx.bytes bytes;
        error_log /var/log/nginx/domains/surenaxxx.xxx.error.log;
        root /home/admin/domains/surenaxxx.xxx/private_html;
        index index.php index.html index.htm;
        ssl_certificate /usr/local/directadmin/data/users/admin/domains/surenaxxx.xxx.cert.combined;
        ssl_certificate_key /usr/local/directadmin/data/users/admin/domains/surenaxxx.xxx.key;
        include /usr/local/directadmin/data/users/admin/nginx_php.conf;
        location /payment/pay-admin/
        {
                auth_basic              "pay-admin";
                auth_basic_user_file    /home/admin/domains/surenaxxx.xxx/.htpasswd/public_html/payment/pay-admin/.htpasswd;
                include /usr/local/directadmin/data/users/admin/nginx_php.conf;
        }
        include /etc/nginx/webapps.ssl.conf;
}

server
{
        listen 192.99.230.000:80;
        server_name go.surenaxxx.xxx www.go.surenahost.xxx ;
        access_log /var/log/nginx/domains/surenaxxx.xxx.go.log;
        access_log /var/log/nginx/domains/surenaxxx.xxx.go.bytes bytes;
        error_log /var/log/nginx/domains/surenaxxx.xxx.go.error.log;
        root /home/admin/domains/surenaxxx.xxx/public_html/go;
        index index.php index.html index.htm;
 
Last edited:
Standard
Code:
cd /usr/local/directadmin/data/templates
cat nginx_server.conf

custom area
Code:
cd /usr/local/directadmin/data/templates/custom
 
also, could it be you are running a prerelease version of DA?

try running
Code:
cd /usr/local/directadmin/custombuild
./build update
./build rewrite_confs
 
I did everything, but the problem was not solved
Also through SSH
Also from the section that is in the new version
/CMD_PLUGINS_ADMIN/custombuild/index.html

I haven't changed the custom build in direction for admin or any user


cd /usr/local/directadmin/data/templates/custom
cd /usr/local/directadmin/data/templates
or in location
usr/local/directadmin/data/users/admin/nginx.conf
i dont changed .


The main page of the site is loaded (WordPress)
But other pages give a 404 error
404 Not Found
for example url > site loaded but link not work , when click on link show this error

Code:
https://mihanfile.com 

https://mihanfile.com/download/%d8%aa%d8%ad%d9%82%db%8c%d9%82-%d8%af%d8%b1%d8%a8%d8%a7%d8%b1%d9%87-%d9%85%db%8c%da%a9%d8%b1%d9%88%d8%b3%da%a9%d9%88%d9%be/


But using WordPress is probably a problem with the WordPress CMS
i think .htaccess permissions in wordpress have interference to nginx conf

This problem arose after the custom build update i haven't problem :(
 
Do you only use Nginx? or are you using nginx_apache? My understanding is nginx doesn't use htacces files. correction doesn't like them
 
Do you only use Nginx? or are you using nginx_apache? My understanding is nginx doesn't use htacces files. correction doesn't like them
if I'm not mistaken
That's it!
nginx

a1.jpg




I didn't change anything, I just updated DA
There was no problem before the update
But now the sites I have are not open



a2.jpg


aaaaa2.jpg
 
Last edited:
make sure you do
View attachment 3404

after the build.
Dear bdacus01
After 4 hours of trying, unfortunately, I couldn't solve the problem
Finally, I installed the Apache service
nginx to apache
Is it possible for me to install the ngnix service via the Direct Admin console?
I DONT NO !
i did set nginx on the console ?
Will it be installed?
Or do I have to install nginx it manually in ssh?
Or did install nginx _apachi first? or after install nginx ?
Is just selecting webserver enough?
Or do I have to re-build?
 
Last edited:
Dear bdacus01
After 4 hours of trying, unfortunately, I couldn't solve the problem
Finally, I installed the Apache service
nginx to apache
Is it possible for me to install the ngnix service via the Direct Admin console?
set nginx on the console alone enough?
Set up nginx on console?
Will it be installed?
Or do I have to install nginx it manually in ssh?

Or do I need to install the nginx _apachi version first?
Next install nginx version?
-------------------------------
Is just selecting webserver enough?
Or do I have to re-build?
If you are still having issue and are not sure. You might add a support ticket if you can or hire someone to look at it. That way they can get it all straight for you.


I can keep helping you if you want as well.
 
If you are still having issue and are not sure. You might add a support ticket if you can or hire someone to look at it. That way they can get it all straight for you.


I can keep helping you if you want as well.



Thank you, but this problem has been raised by various users in the forums.

Why is there no proper guidance in this regard?
Or solve and fix this problem in future DA updates?
I don't think there should be a particular problem and it's a normal interference, I would like to know for myself where is the problem, Because I want to understand the reason for this error.


Why there isn't really good guidance in this regard?
Or is this problem not solved?
Maybe I don't understand!

It is incomprehensible and vague
# For global config changes that affect all Users, see this guide:

# http://help.directadmin.com/item.php?id=558
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3
 
What is the latest status? did you managed to install nginx ?
Do you use any custom lines in your "Custom HTTP Configurations "?

Maybe its easier to have Nginx as reverse proxy for Apache, then you can use .htaccess files if desired

Code:
cd /usr/local/directadmin/custombuild
./build update
./build set webserver nginx_apache
./build nginx_apache
./build rewrite_confs
 
Thank you, but this problem has been raised by various users in the forums.

Why is there no proper guidance in this regard?
Or solve and fix this problem in future DA updates?
I don't think there should be a particular problem and it's a normal interference, I would like to know for myself where is the problem, Because I want to understand the reason for this error.


Why there isn't really good guidance in this regard?
Or is this problem not solved?
Maybe I don't understand!

It is incomprehensible and vague
# For global config changes that affect all Users, see this guide:

# http://help.directadmin.com/item.php?id=558
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3
You know this is a user forum. I don't work for the company. I have no idea. I am just one user trying to help another.
 
Last edited:
|CUSTOM1| ?DOCROOT=`HOME`/domains/`DOMAIN`/public_html| ?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|

You pasted it from your custom template :) Didn't you notice anything strange there?

All are in 1 line, two instances of "|" missing. It's normal it caused issues there.
 
What is the latest status? did you managed to install nginx ?
Do you use any custom lines in your "Custom HTTP Configurations "?

Maybe its easier to have Nginx as reverse proxy for Apache, then you can use .htaccess files if desired

Code:
cd /usr/local/directadmin/custombuild
./build update
./build set webserver nginx_apache
./build nginx_apache
./build rewrite_confs
Unfortunately no,
right now i replaced the Apache service , until find What is trouble


----------------
You know this is a user forum. I don't work for the company. I have no idea. I am just one user trying to help another.
bdacus01 😍
Thank you very much
, you are a valuable person in this forum.
I saw ,most of answered "questions" ,for you and someone named Alex in this forum.
Thank you very much for your kindness
 
Last edited:
You pasted it from your custom template :) Didn't you notice anything strange there?

All are in 1 line, two instances of "|" missing. It's normal it caused issues there.

This error is in line 12.
There is nothing to start this line
This error only appears in this file
usr/local/directadmin/data/users/admin/nginx.conf


I did not notice the error!
Because there is only one
}
.
I even deleted the line , deleted the first paragraph, and again there is the same error

Code:
[root@server9 admin]# nano nginx.conf
  GNU nano 2.0.9                                                                  File: nginx.conf


# Auto generated nginx config file by DirectAdmin version 1.61.1
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to their website

# For global config changes that affect all Users, see this guide:
# http://help.directadmin.com/item.php?id=558
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3

?DOCROOT=`HOME`/domains/`DOMAIN`/public_html| ?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|
server
{   ************************************************************************* Line 12
        listen 192.99.230.000:80;
        server_name surenaxxx.xxx www.surenaxxx.xxx ;
        access_log /var/log/nginx/domains/surenaxxx.xxx.log;
        access_log /var/log/nginx/domains/surenaxxx.xxx.bytes bytes;
        error_log /var/log/nginx/domains/surenaxxx.xxx.error.log;
        root |DOCROOT|;
        index index.php index.html index.htm;
        include /usr/local/directadmin/data/users/admin/nginx_php.conf;
        location /payment/pay-admin/
        {
                auth_basic              "pay-admin";
                auth_basic_user_file    /home/admin/domains/surenaxxx.xxx/.htpasswd/public_html/payment/pay-admin/.htpasswd;
                include /usr/local/directadmin/data/users/admin/nginx_php.conf;
        }
        include /etc/nginx/webapps.conf;
}

server
{
        listen 192.99.230.000:443 ssl http2;
        server_name surenaxxx.xxx www.surenaxxx.xxx ;
        access_log /var/log/nginx/domains/surenaxxx.xxx.log;
        access_log /var/log/nginx/domains/surenaxxx.xxx.bytes bytes;
        error_log /var/log/nginx/domains/surenaxxx.xxx.error.log;
        root /home/admin/domains/surenaxxx.xxx/private_html;
        index index.php index.html index.htm;
        ssl_certificate /usr/local/directadmin/data/users/admin/domains/surenaxxx.xxx.cert.combined;
        ssl_certificate_key /usr/local/directadmin/data/users/admin/domains/surenaxxx.xxx.key;
        include /usr/local/directadmin/data/users/admin/nginx_php.conf;
        location /payment/pay-admin/
        {
                auth_basic              "pay-admin";
                auth_basic_user_file    /home/admin/domains/surenaxxx.xxx/.htpasswd/public_html/payment/pay-admin/.htpasswd;
                include /usr/local/directadmin/data/users/admin/nginx_php.conf;
        }
        include /etc/nginx/webapps.ssl.conf;
}

server
{
        listen 192.99.230.000:80;
        server_name go.surenaxxx.xxx www.go.surenahost.xxx ;
        access_log /var/log/nginx/domains/surenaxxx.xxx.go.log;
        access_log /var/log/nginx/domains/surenaxxx.xxx.go.bytes bytes;
        error_log /var/log/nginx/domains/surenaxxx.xxx.go.error.log;
        root /home/admin/domains/surenaxxx.xxx/public_html/go;
        index index.php index.html index.htm;


really i didn't understand what the error was with this line



[root@server9 custom]# service nginx restart
nginx: [emerg] unknown directive "?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|" in /usr/local/directadmin/data/users/admin/nginx.conf:12
nginx: configuration file /etc/nginx/nginx.conf test failed



missing "|" this line?

Code:
?DOCROOT=`HOME`/domains/`DOMAIN`/public_html| ?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|

true ?
Code:
 |?DOCROOT=`HOME`/domains/`DOMAIN`/public_html| ?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|
 
Last edited:
Back
Top