Installed nginx with iredmail; how to add web content & test without DNS change

Francis Daly francis at daoine.org
Sat May 2 07:54:02 UTC 2015


On Fri, May 01, 2015 at 08:50:51PM -0400, gariac wrote:

Hi there,

> I think I failed to explain my problem correctly. It seems to me whatever I
> do for the test would be on the server side, not client side. Studying your
> reply, I think your solution maps domain.com to ipaddress (dotted quad) from
> the client side. What I need to do is have the one ip address I have for the
> server  host iredmail and my website.

I had misunderstood your issue.

See http://nginx.org/r/server and links.

Basically: some web applications can sensibly be installed
in a "subfolder" of the web space, so you can access them at
http://www.example.com/app1/. Other web applications insist on owning
the full web space, so you must use http://app1.example.com/.

If iredmail is in the latter group, then in your one nginx conf file,
have one server{} block for iredmail, and a separate server{} block
(with a different server_name) for your website.

> I created a /var/www2 with a different index.html, but I don't see how nginx
> would know which directory to use.

If you have separate server{} blocks, nginx picks the one to use based
on its rules.

> I was able to get nginx working with my website prior to having iredmail on
> the same server. Having both services on the same server is what confuses
> me.

They can be in the same nginx instance without a problem.

The can only be in the same nginx server{} block if both play nice.

In that case, you must decide how you want nginx to handle the request
for "/", and configure it to do that.

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list