LMSouq
server-admin AI Answered

Configure nginx with multiple locations with different root folders on subdomain

SI
simoes
1 month ago
5 views
Problem Description
I'm looking to serve the root url of a subdomain and directory of a subdomain to two different folders on my server. Here is the simple set-up that I have and is not working... server { index index.html index.htm; server_name test.example.com; location / { root /web/test.example.com/www; } location /static { root /web/test.example.com/static; } } In this example going to `test.example.com/` would bring the index file in `/web/test.example.com/www` and going to `test.example.com/static` would bring the index file in `/web/test.example.com/static`

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base