Here's how you can do it:
-
Create a New Server Block Configuration File: First, create a new Nginx server block configuration file for your subdomain. You can create this file in the
/etc/nginx/sites-available/
directory. Replacesubdomain.example.com
with your actual subdomain:sudo nano /etc/nginx/sites-available/subdomain.example.com
-
Configure the Server Block: