Well, at this moment thanks to this tutorial I managed to configure Nginx correctly and now when I go to the subdomain of my website, everything works perfectly.

What the tutorial does not mention is how I can add a second domain in the /etc/nginx/sites-enabled/mydomain file since at the end of the tutorial the document already has an SSL certificate that points to a specific IP address and domain.

I have read that it is as simple as "copy and paste below the “server” block but in that specific example there are two server blocks, and if I try to create another file using the same content of that one but changing the IP and subdomain, I get an error when trying to restart Nginx saying there can’t be two files pointing to ::[80]:

ChojinDSL
link
fedilink
English
01Y

Sorry didn’t read your post entirely before I answered. Are you trying to have a second separate site, or just an alternative domain pointing to the same site?

Create a post

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don’t control.

Rules:

  1. Be civil: we’re here to support and learn from one another. Insults won’t be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it’s not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don’t duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

  • 1 user online
  • 127 users / day
  • 422 users / week
  • 1.16K users / month
  • 3.85K users / 6 months
  • 1 subscriber
  • 3.68K Posts
  • 74.2K Comments
  • Modlog