Hello Dear DirectAdmin Community ,
I used the following commands to switch Apache to nginx_apache in directadmin :
After the process , I noticed an Nginx error :
Upon further investigation , I noticed duplicate lines in /etc/nginx/nginx-vhosts.conf :
and
as you can see , there are duplicate lines for listen 127.0.0.1:80; and listen 127.0.0.1:443 ssl; .
Now , I can manually edit the file and save it but upon running da build rewrite_confs , the generated file again contains the duplicate entries .
Below is the full config file /etc/nginx/nginx-vhosts.conf :
How can I figure out what's causing the duplicate lines ? Thank you .
Kind Regards ,
I used the following commands to switch Apache to nginx_apache in directadmin :
Code:
da build set webserver nginx_apache
da build nginx_apache
da build php
da build rewrite_confs
After the process , I noticed an Nginx error :
Code:
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xeu nginx.service" for details.
Upon further investigation , I noticed duplicate lines in /etc/nginx/nginx-vhosts.conf :
Code:
listen 88.88.88.88:80;
listen 127.0.0.1:80;
listen 127.0.0.1:80;
listen [::1]:80;
and
Code:
listen 88.88.88.88:443 ssl;
listen 127.0.0.1:443 ssl;
listen 127.0.0.1:443 ssl;
listen [::1]:443 ssl;
as you can see , there are duplicate lines for listen 127.0.0.1:80; and listen 127.0.0.1:443 ssl; .
Now , I can manually edit the file and save it but upon running da build rewrite_confs , the generated file again contains the duplicate entries .
Below is the full config file /etc/nginx/nginx-vhosts.conf :
Code:
server {
listen 88.88.88.88:80;
listen 127.0.0.1:80;
listen 127.0.0.1:80;
listen [::1]:80;
server_name $hostname 88.88.88.88;
root /var/www/html;
location / {
access_log off;
proxy_pass http://88.88.88.88: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 /var/www/html/;
internal;
}
# deny access to .htaccess, .env and .user.ini files
location ~ /(\.ht|\.env|\.user\.ini) {
deny all;
}
include /etc/nginx/nginx-info.conf;
include /etc/nginx/webapps.hostname.conf;
}
# HTTPS server
#
server {
listen 88.88.88.88:443 ssl;
listen 127.0.0.1:443 ssl;
listen 127.0.0.1:443 ssl;
listen [::1]:443 ssl;
http2 on;
server_name $hostname 88.88.88.88;
ssl_certificate /etc/httpd/conf/ssl.crt/server.crt.combined;
ssl_certificate_key /etc/httpd/conf/ssl.key/server.key;
root /var/www/html;
location / {
access_log off;
proxy_pass https://88.88.88.88:8081;
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 /var/www/html/;
internal;
}
# deny access to .htaccess, .env and .user.ini files
location ~ /(\.ht|\.env|\.user\.ini) {
deny all;
}
include /etc/nginx/nginx-info.conf;
include /etc/nginx/webapps.hostname.conf;
}
How can I figure out what's causing the duplicate lines ? Thank you .
Kind Regards ,