I have a domain (example.com) that I am trying to use subdomains to show different parts of the applications. Right now is all Hosted in AWS.
This is sort of the set up I am trying to go for.
sbx.example.com
trn.example.com
office.example.com
My nginx conf right now is as follow:
server {
listen 80;
root /var/www/html/apt-front/dist;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name example.com www.example.com;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location /api{
alias "/var/www/html/api/public";
try_files $uri $uri/ @api;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/html/mint-api/public/index.php;
}
}
location @api {
rewrite /api/(.*)$ /api/index.php?/$1 last;
}
include /etc/nginx/sites-available/*.conf;
}
I know that in AWS i would need to create a record for the domain, i believe that would be a NS record with the name of the subdomain (such as sbx.example.com). What I was thinking of doing is creating another repository (a clone) with the changes that i need for SBX, create another server block and under server name just change the subdomain? Thoughts?