I have three static sites. I am using Vue 2 and running build for each folder.
I want to host all three static files on the same server instance. Right now I don't have domain so i want to host on server's IP itself.
I have folder in html/www folder
first_folder
second_folder
third_folder
All the above three folders have index.html file in it.
Let's say that I have an IP address 3.12.178.229
I want to access folders like
http://3.12.178.229 // i.e path for first_folder
http://3.12.178.229/second_path // i.e path for second_folder
http://3.12.178.229/third_path // i.e path for third_folder
I am able to access the index.html file which first_folder has, but when I am trying to access second_folder using IP http://3.12.178.229/second_folder It does not show anything.
{
listen 80;
server_name 3.12.178.229;
location / {
root path_to_first_folder/first_folder; // I am able to access this
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /second_path {
root path_to_first_folder/second_folder; // I am able to access this
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /third_path {
root path_to_first_folder/third_folder; // I am able to access this
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}