How I can change XML files are handled by Nginx (Debian)

Posted on

How I can change XML files are handled by Nginx (Debian) – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, apache-2.2, nginx, bind, curl.

On my server, XML files are handled by Nginx. They should be handled by Apache so that .htaccess file is working

I have checked the cURL not working properly

When I run the command curl -I https://www.example.com/sitemap.xml

curl: (7) Failed to connect
Failed to connect on all port

nginx -t
nginx: [emerg] BIO_new_file("/home/admin/conf/web/ssl.xvids.cc.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/home/admin/conf/web/ssl.xvids.cc.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)

nginx: configuration file /etc/nginx/nginx.conf test failed

/var/log/syslog

Aug  9 06:25:25 srv named[30476]: client 104.42.128.152#51441 (hostsahibi2.dnsservis.com): query (cache) 'hostsahibi2.dnsservis.com/A/IN' denied

ls -l /home/admin/conf/web/

total 144
-rw-r----- 1 root admin 11402 Aug  9 09:53 apache2.conf
-rw-r----- 1 root admin 12517 Aug  9 10:18 nginx.conf
-rw-r----- 1 root root  11268 Jul 24 15:02 nginx.conf.backup
-rw-r--r-- 1 root root    147 Aug  9 09:53 nginx.dev.xvids.cc.conf_letsencrypt
-rw-r--r-- 1 root root    147 Jul 20 20:05 nginx.xchum.com.conf_letsencrypt
-rw-r--r-- 1 root root    147 Jul 19 13:39 nginx.xvids.cc.conf_letsencrypt
-rw-r--r-- 1 root root    147 Jul 20 20:52 nginx.xvids.in.conf_letsencrypt
drwxr-xr-x 2 root root   4096 Jul 19 13:35 old_server
-rw-r--r-- 1 root root     68 Jul 18 20:56 pam.htpasswd
-rw-r----- 1 root admin  4591 Aug  9 10:43 sapache2.conf
-rw-r----- 1 root admin  4903 Aug  9 10:53 snginx.conf
-rw-r----- 1 root admin  5186 Aug  9 10:21 snginx.conf.save
-rw-r----- 1 root root   1647 Aug  9 09:53 ssl.dev.xvids.cc.ca
-rw-r----- 1 root root   2134 Aug  9 09:53 ssl.dev.xvids.cc.crt
-rw-r----- 1 root root   3243 Aug  9 09:53 ssl.dev.xvids.cc.key
-rw-r----- 1 root root   3782 Aug  9 09:53 ssl.dev.xvids.cc.pem
-rw-r----- 1 root root   1647 Jul 20 20:31 ssl.xchum.com.ca
-rw-r----- 1 root root   2147 Jul 20 20:31 ssl.xchum.com.crt
-rw-r----- 1 root root   3243 Jul 20 20:31 ssl.xchum.com.key
-rw-r----- 1 root root   3795 Jul 20 20:31 ssl.xchum.com.pem
-rw-r----- 1 root root   5625 Aug  9 10:43 ssl.xvids.cc.ca
-rw-r----- 1 root root   2223 Aug  9 10:43 ssl.xvids.cc.crt
-rw-r----- 1 root root   3243 Aug  9 10:43 ssl.xvids.cc.key
-rw-r----- 1 root root   7849 Aug  9 10:43 ssl.xvids.cc.pem

Solution :

Your Nginx web server is not running. You are trying to enable https on your Nginx but you don’t load the SSL certificates files from the correct path.

directory:fopen('/home/admin/conf/web/ssl.xvids.cc.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file

Do you have a valid certificate? If yes, you have to define the correct paths in the Nginx’s configuration file in the following directives.

ssl_certificate path-for-crt;
ssl_certificate_key path-for-key;

Leave a Reply

Your email address will not be published. Required fields are marked *