If this is feasible, and I’d guess it is, then I’m not sure how to begin
setting up locations that will serve requests from those subdirectories.
In all cases, when trying something like www.domain1.com, nginx
invariably
maps to the root directory. Typing www.domain1.com/blog, for example,
works
just fine. I know I must be missing some essential info on how to
configure
nginx for this type of thing, and any hint or direction would be
appreciated.
On Monday, November 24, 2014 09:08:08 PM angelox wrote:
If this is feasible, and I’d guess it is, then I’m not sure how to begin
setting up locations that will serve requests from those subdirectories.
In all cases, when trying something like www.domain1.com, nginx invariably
maps to the root directory. Typing www.domain1.com/blog, for example, works
just fine. I know I must be missing some essential info on how to configure
nginx for this type of thing, and any hint or direction would be
appreciated.
Leon
Hi,
My personal off-topic advice is to put your website data to something
like /var/www instead of /usr/share/nginx in order to keep your package
manager happy and to comply with the FHS recommendations:
To answer your question, the config can be as follows:
server {
server_name blog.example.org;
root /var/www/blog;
…
}
server {
server_name wiki.example.org;
root /var/www/wiki;
…
}
At the time my server was setup, Ubuntu 12.04’s repositories were
outdated,
so I added a repository with the latest development version of nginx,
which
was as stable and supported as a final release, and by default the web
files
were located in /usr/share/nginx/html. I had no say in that. I’ve
updated it
many times since, and never had any issues. In any event, I’ll
reconsider
moving my web files to a standard directory, as it is always a good
idea.
Thank you for mentioning it.
The examples you sent me worked like a charm, and now I’m a bit closer
of
going live.
Best of luck,
Leon R.
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.