Nginx how to get certificate for 3 domains on a vps

No, that would break your nginx. The server block shown is incomplete as I said earlier. It should contain more at the bottom, such as the server_name directive and a least the closing }.

4 Likes

Hi Osiris, thank again for your help but i am not sure about what to do since there is a duplicate and you say i have to complete the last part of the server block?
regards Peter

1 Like

You don't need to complete anything. I was trying to say there should be more lines in the configuration file than what you've shown here.

If you'd delete just the lines you've shown here and thus leave some other parts of the block in the configuration file,
you'd break nginx.

You need to find the entire duplicate server block.

3 Likes

I will be brutally honest here, i have not a single clue about how to do this, keep in mind i am a game dev and not a web dev unfortunately!
regards peter

OK i did my best and tried to fix the configuration block but still no luck, here is my server block configuration ;

server {

     server_name naos-soultrap.online www.naos-soultrap.online;

     root /home/pierre/public/naossoultrap;

     index index.html index.htm;

     location / {
          try_files $uri $uri/ =404;
     }

    listen [::]:443 ssl http2 ipv6only=on; # managed by Certbot
    listen 443 ssl http2; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/escapingthematrix.online/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/escapingthematrix.online/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}
server {
    if ($host = www.naos-soultrap.online) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    if ($host = naos-soultrap.online) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


     listen 80;
     listen [::]:80;
     server_name naos-soultrap.online www.naos-soultrap.online;
    return 404; # managed by Certbot


}
server {
    if ($host = naos-soultrap.online) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

 listen 80;

     server_name naos-soultrap.online www.naos-soultrap.online;
     return 404; # managed by Certbot


}

You can delete the last server block in its entirety to avoid the duplicate. The prior one to that handles both domain names just fine. So, remove this one.

Well, not any more :slight_smile: You are now responsible for an nginx server too.

Keep in mind we are a site primarily staffed with volunteers that help get and use Let's Encrypt certs. Educating people on nginx config isn't a focus. We wouldn't be able to help as many if we had to do that with everyone. I don't mean to be harsh it's just how it is. You should review the nginx docs so you better understand this server you are setting up (docs here)

5 Likes

Thank a lot Mike i really appreciate your help and i understand you guy's don't have to answer to all so no worry here!
I did read a few time the nginx docs but could not find or understand correctly what need to be change in my own case, i even look at other server block config to have an idea and there is so many different type of config that it simply made me more confuse.
I am a one man army doing everything by myself including music composition for my game and graphic design + coding and now managing a webserver so at 58 i am getting a little old for more loll
Anyway have a fantastic weekend guy's your support in this thread was simply astounding and i am sure it is going to help many others
By the way when my game will be release i will send you all a free copy in about 2 or 3 month if you would like it, it's a first person shooter with a pretty original concept.
regards Peter

3 Likes

I'm game, as long as it runs on Linux :wink:

3 Likes

Hi Osiris, would like to port the game for linux but this will depend upon the initial success i get with the pc release. If successful and i can hire more programmers then i will consider it since it is not an easy task. There is an article here mentioning the main difficulty ;

regards Peter

OK, thank to all of you guy's everything is working fine for all websites with no error at all. I would not have been able to make it work without you so i earn you a big one! Hope this thread will help many others.
Regards Peter

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.