Consider that in your project you have multiple module such as admin panel , buyer front end , seller front end and you need to run these module in single url like localhost:8080/admin for admin ,localhost:8080/ for buyer and localhost:8080/seller for seller.The NGINX configuration that can be used is as follows:
server {
listen 8080;
server_name localhost;
root /home/ajit/git/univisior;
location / {
alias /home/ajit/git/project-x/buyer/dist/;
index index.html;
try_files $uri $uri/ /index.html;
}
location /admin{
alias /home/ajit/git/project-x/admin/dist/;
index index.html;
try_files $uri $uri/ index.html;
}
location /seller {
alias /home/ajit/git/project-x/seller/dist/;
index index.html;
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass http://localhost:3000/api;
}
}
THANKS
More From Oodles
Ready to innovate? Let's get in touch
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
S. Ajit
Ajit is a software developer who loves solving problems and programming in C, C++, Java. He also has a passion to learn new technologies.