nginx configuration for multiple sites on same server
<p>I am trying to create a nginx server that can host multiple sites on the same server. I have kept two different directories containing index.html files in the /var/www/ directory. </p>

<p>1st directory : dir1
Containing folder strucuture as : dir1/Folder/app;
app directory contains index.html for the site.</p>

<p>2nd directory : dir2
Containing folder strucuture as : dir2/Folder/app;
app directory contains index.html for the site.</p>

<p>now inside /etc/nginx/conf.d, created 2 .conf files as test.conf and dev.conf</p>

<p>test.conf : </p>

<pre><code>server {
    listen 80 default_server;
    server_name mydomain.net;
    location /dir1/ {
        root /var/www/dir1/PharmacyAdminApp/app;
        index index.html index.htm;
        try_files $uri $uri/ =404;
    }
}
</code></pre>

<p>dev.conf</p>

<pre><code>server {
    listen 80 default_server;
    server_name mydomain.net;
    location /dir2/ {
        root /var/www/dir2/PharmacyAdminApp1/app;
        index index.html index.htm;
        try_files $uri $uri/ =404;
    }
}
</code></pre>

<p>After this I restart the nginx server and visit "mydomain.net:80/dir1" on the browser but I get 404. Can anyone let me know what is the issue?</p>