Well, I couldn’t make it work
I set the second domain like this
cp /etc/nginx/sites-available/meet.treebes.com.conf meet.comercia.io.conf
Then I searched and replaced every treebes.com for comercia.io, saved and ran this
nginx -t -c meet.comercia.io
nginx: [emerg] open() "/usr/share/nginx/meet.comercia.io" failed (2: No such file or directory)
nginx: configuration file /usr/share/nginx/meet.comercia.io test failed
I thought that maybe the log could tell me more, so I ran
systemctl reload nginx
Job for nginx.service failed.
I checked what went wrong
systemctl status nginx.service
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2022-05-10 16:36:50 UTC; 1 day 23h ago
Docs: man:nginx(8)
Process: 13815 ExecReload=/usr/sbin/nginx -g daemon on; master_process on; -s reload (code=exited, status=1/FAILU>
Main PID: 2306 (nginx)
Tasks: 2 (limit: 1131)
Memory: 12.9M
CGroup: /system.slice/nginx.service
├─ 2306 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
└─13576 nginx: worker process
May 12 15:15:42 meet.treebes.com systemd[1]: Reloading A high performance web server and a reverse proxy server.
May 12 15:15:42 meet.treebes.com nginx[13266]: nginx: [emerg] "server_names_hash_bucket_size" directive is duplicate >
May 12 15:15:42 meet.treebes.com systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
May 12 15:15:42 meet.treebes.com systemd[1]: Reload failed for A high performance web server and a reverse proxy serv>
May 12 15:22:12 meet.treebes.com systemd[1]: Reloading A high performance web server and a reverse proxy server.
May 12 15:22:12 meet.treebes.com systemd[1]: Reloaded A high performance web server and a reverse proxy server.
May 12 16:02:45 meet.treebes.com systemd[1]: Reloading A high performance web server and a reverse proxy server.
May 12 16:02:45 meet.treebes.com nginx[13815]: nginx: [emerg] "server_names_hash_bucket_size" directive is duplicate >
May 12 16:02:45 meet.treebes.com systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
May 12 16:02:45 meet.treebes.com systemd[1]: Reload failed for A high performance web server and a reverse proxy serv>
The part “nginx: [emerg] “server_names_hash_bucket_size” directive is duplicate” made me think that it was because of the cp instead of creating a new file, so I deleted the meet.comercia.io.conf and created a new one with this inside
server {
listen 80;
listen [::]:80;
server_name meet.comercia.io;
root /usr/share/jitsi-meet;
index index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
}
The root is the same of the meet.treebes.com.conf file, but when I ran the test, it failed again with the same message
I ran the command again
systemctl reload nginx
And there was no output now, so I checked status
systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2022-05-10 16:36:50 UTC; 1 day 23h ago
Docs: man:nginx(8)
Process: 13859 ExecReload=/usr/sbin/nginx -g daemon on; master_process on; -s reload (code=exited, status=0/SUCCE>
Main PID: 2306 (nginx)
Tasks: 2 (limit: 1131)
Memory: 11.6M
CGroup: /system.slice/nginx.service
├─ 2306 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
└─13860 nginx: worker process
May 12 15:15:42 meet.treebes.com systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
May 12 15:15:42 meet.treebes.com systemd[1]: Reload failed for A high performance web server and a reverse proxy serv>
May 12 15:22:12 meet.treebes.com systemd[1]: Reloading A high performance web server and a reverse proxy server.
May 12 15:22:12 meet.treebes.com systemd[1]: Reloaded A high performance web server and a reverse proxy server.
May 12 16:02:45 meet.treebes.com systemd[1]: Reloading A high performance web server and a reverse proxy server.
May 12 16:02:45 meet.treebes.com nginx[13815]: nginx: [emerg] "server_names_hash_bucket_size" directive is duplicate >
May 12 16:02:45 meet.treebes.com systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
May 12 16:02:45 meet.treebes.com systemd[1]: Reload failed for A high performance web server and a reverse proxy serv>
May 12 16:04:03 meet.treebes.com systemd[1]: Reloading A high performance web server and a reverse proxy server.
May 12 16:04:04 meet.treebes.com systemd[1]: Reloaded A high performance web server and a reverse proxy server.
I don’t know what the sentence “Reloading A high performance web server and a reverse proxy server.” may be; but the output is the same for both conf files
nginx -t -c meet.comercia.io
nginx: [emerg] open() "/usr/share/nginx/meet.comercia.io" failed (2: No such file or directory)
nginx: configuration file /usr/share/nginx/meet.comercia.io test failed
nginx -t -c meet.treebes.com
nginx: [emerg] open() "/usr/share/nginx/meet.treebes.com" failed (2: No such file or directory)
nginx: configuration file /usr/share/nginx/meet.treebes.com test failed
I couldn’t either create a certificate for meet.comercia.io, the output was this
certbot --nginx -d meet.comercia.io
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for meet.comercia.io
nginx: [emerg] "server_names_hash_bucket_size" directive is duplicate in /etc/nginx/sites-enabled/meet.treebes.com.conf:1
Cleaning up challenges
nginx restart failed:
b''
b''
Ah, yes, I also ran this command
ln -s /etc/nginx/sites-available/meet.comercia.io.conf /etc/nginx/sites-enabled/meet.comercia.io.conf
And retested, every prompt was the same
I also made a copy of the /etc/jitsi/meet/meet.treebes.com-config.js file as/etc/jitsi/meet/meet.comercia.io-config.js with search and replace of the text as I made above; but still nothing works for meet.comercia.io
Right now, you can enter in both urls, meet.treebes.com and meet.comercia.io; but only the first one works