[BUG] LINKED-IPS has broken duo nginx-vhost.conf and directadmin-ips.conf has different template

Ohm J

Verified User
Joined
Aug 16, 2019
Messages
1,782
Centos 8
Directadmin 1.62.9
Nginx_Apache

this line something went wrong

#/usr/local/directadmin/custombuild/build
Code:
if [ "`/usr/local/directadmin/dataskq h | grep -c '\-\-linked-ips'`" -gt "0" ]; then
If I remove this condition,
nginx-vhost, and httpd-vhost it linked-ips normally

If I run in console

#/usr/local/directadmin/dataskq h | grep -c '\-\-linked-ips'


I try to find problem from this threads


in now I solves problem with custom template "nginx-ips.conf" with add condition between nginx and nginx_apache for use my own


###EDIT
it start broken on 1.62.4 [ Stable Channel ]
maybe It broken long time ago, But I don't have time to check, until this month
 
Last edited:
look like

/etc/nginx/directadmin-ips.conf
have been broken

I think, this template it for Nginx Unit / Nginx Only

I use Nginx_Apache
so It should use in nginx-vhost.conf that currently linked-ips broken, because doesn't add second ips

even I add IP to nginx-vhost.conf it still can't use because conflic with direcadmin-ips.conf which have "default" block
 
Last edited:
after few test

1: it wrong regex when on "directadmin-ips.conf" that include from "webapps.{ssl}.conf"
location ~ ^/roundcube/nginx_static_files/ {
location ~ ^/phpMyAdmin/nginx_static_files/ {
I don't know why wrong regex,
maybe cause by PCRE with different version which different OS ?
I just notice issued in this month

2: Main IP Work because it run on "nginx-vhost.conf"

Correct regex should be
location ^~ /roundcube/nginx_static_files/ {
location ^~ /phpMyAdmin/nginx_static_files/ {
 
Last edited:
@smtalk
could you check for me ?

ip linked broken on hostname
maybe template "nginx-ips.conf" don't support on nginx_apache

main ips worked because it still use "nginx-vhost.conf"

"nginx-vhost.conf" different than template "nginx-ips.conf"

Any "/phpmyadmin" or "/roundcoube" static file won't work.
 
@jamgames2 thanks for reporting this issue with custombuild and linked-ips. In recent releases the help output of dataskq has changed slightly and this broke custombuild line that checks dataskq for --linked-ips argument support.

We have pushed an update to custombuild with a fix.
 
@fln
nginx-vhost.conf now have correct ips

but static file still won't work duo "directadmin-ips.conf" conflic with "nginx-vhost.conf" and have flag
"default_server"
listen 1.1.1.2:80 default_server;
listen 1.1.1.2:443 ssl http2 default_server;

maybe I think, should remove "default_server"

and in "nginx.conf"
if include before "include /etc/nginx/nginx-vhosts.conf;" it still not working

move
include /etc/nginx/directadmin-ips.conf;
to after line "include /etc/nginx/nginx-vhosts.conf;"
it should look like this

include /etc/nginx/nginx-modsecurity-enable.conf;
include /etc/nginx/nginx-defaults.conf;
include /etc/nginx/nginx-gzip.conf;
include /etc/nginx/nginx-proxy.conf;
include /etc/nginx/directadmin-settings.conf;
include /etc/nginx/nginx-vhosts.conf;
include /etc/nginx/directadmin-ips.conf;
include /etc/nginx/directadmin-vhosts.conf;
 
Last edited:
@fln
I just found some strange.

it relate to nginx itself, via "X-Accel-Internal"
if file size larger than 1M ( 1023K ), it will be 404 not found.
I will find some config to make it more than 1M
 
In this fixed way,
I can see debug header ( addheader test_header 'this is block') come from internal location block.

without change regex, it come from proxy_pass, not from internal block.

this problem relate to location block regex
even new server still wrong regex.

could you guy confirm this ?

it small bug that I can work around fixed. but it should have alternative way to fix this issued.
 
Back
Top