Serving static content from a sub url?

Hello,

I have a static website on my machine at
/home/me/www/public

I simply want to serve that from a sub url on my domain:
http://www.mydomain.com/mysite

How do I do that?

I tried this but it didn’t work…

server {
listen 80;
server_name www.mydomain.com;
location /mysite {
index index.html;
root /home/me/www/public;
}
}

Thanks for the help.

Posted at Nginx Forum:

try this:

  • root /home/me/www/public;
  • alias /home/me/www/public;

Posted at Nginx Forum:

That worked! Thank you.

Posted at Nginx Forum: