I got 2 domains.
domain1.com and domain2.com both take place on Cloudflare nameservers and linked to the one server ( A records of the same ip).
But when I'm trying to configurate two sites on the single server. I got Cloudflare error 1000
I make setup nginx for the first domain. Created the conf file in sites-available and linked it to sites-enabled. Here is the domain1.conf that stores in sites-available and linked to sites-enabled. domain1.conf:
server {
server_name domain1.com, www.domain1.com;
listen 80;
location / {
proxy_pass https://somehost/;
proxy_redirect default;
}
}
server {
server_name domain1.com, www.domain1.com;
listen 443 ssl;
location / {
proxy_pass https://somehost/;
proxy_redirect default;
}
ssl_certificate crt;
ssl_certificate_key key;
}
It works perfectly. Also, with this confinguration file, when I'm trying to access domain2.com it shows me the domain1.com content.
And when I'm trying to create domain2.conf file in sites-available, and link it to sites-enabled, I'm recieving the Cloudflare error 1000 on both sites.
domain2.conf:
server {
server_name domain2.com, www.domain2.com;
listen 80;
location / {
proxy_pass https://someotherhost/;
proxy_redirect default;
}
}
server {
server_name domain2.com, www.domain2.com;
listen 443 ssl;
location / {
proxy_pass https://someotherhost/;
proxy_redirect default;
}
ssl_certificate crt;
ssl_certificate_key key;
}
Also, when I'm trying to cat both files in a single domain1-2.conf file, I got the same error.
There is no other files or links in sites-available and sites-enabled. The server is ubuntu20.04 I need to work multiple sites on single server. What am I doing wrong?