1

Topic: Problems with configuration in nginx

Hello, the first thing I want to ask is if iredmail can coexist with other virtual ones within nginx.
My question is this because I have a server running with several virtual and when I install iredmail lost access to all virtual, any url that I call goes directly to the webmail of iredmail.
I have configured the ngnix virtual but they do not respond all go to the webmail of iredmail and I also stop working the https for the other applications, I can only access by ip and http, not https.
This happens to me since I install iredmail, surely the installation changes nginx configurations but I can not find them.

Greetings and thanks

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Problems with configuration in nginx

Nginx configured by iRedMail loads files from some directories, you need to make sure your virtual web host config files are loaded by Nginx. Please start with /etc/nginx/nginx.conf, check the "include ..." directives.

3

Re: Problems with configuration in nginx

ZhangHuangbin wrote:

Nginx configured by iRedMail loads files from some directories, you need to make sure your virtual web host config files are loaded by Nginx. Please start with /etc/nginx/nginx.conf, check the "include ..." directives.

Hi, thanks for your response.
This is my conf from /etc/nginx/nginx.conf

user www-data;
worker_processes 1;
pid /var/run/nginx.pid;

events {
    worker_connections 1024;
}

http {
    include /etc/nginx/conf-enabled/*.conf;
    include /etc/nginx/sites-enabled/*.conf;


In the 00-default.conf I have this:

server {
    # Listen on ipv4
    listen 80;

    # Listen on ipv6.
    # Note: this setting listens on both ipv4 and ipv6 with Nginx release
    #       shipped in some Linux/BSD distributions.
    #listen [::]:80;

    server_name _;

    # Redirect all insecure http:// requests to https://
    return 301 https://$host$request_uri;
}

In the 00-default-ssl.conf I have this:

server {
    listen 443;
    server_name _;

    root /var/www/html;
    index index.php index.html;

    include /etc/nginx/templates/misc.tmpl;
    include /etc/nginx/templates/ssl.tmpl;
    include /etc/nginx/templates/iredadmin.tmpl;
    include /etc/nginx/templates/roundcube.tmpl;
    include /etc/nginx/templates/sogo.tmpl;
    include /etc/nginx/templates/netdata.tmpl;
    include /etc/nginx/templates/php-catchall.tmpl;
    include /etc/nginx/templates/stub_status.tmpl;
}

Then I have other virtual ones that were working until I installed iredmail, since I install when I call any virutal the webmail of iredmail always speaks to me.
I do not see anything more than this.

Thanks for your answer

4

Re: Problems with configuration in nginx

ffrcaraballo wrote:

Then I have other virtual ones that were working until I installed iredmail, since I install when I call any virutal the webmail of iredmail always speaks to me.

Do you have config files for these web hosts under /etc/nginx/sites-enabled/ (and ends with '.conf')?

5

Re: Problems with configuration in nginx

ZhangHuangbin wrote:
ffrcaraballo wrote:

Then I have other virtual ones that were working until I installed iredmail, since I install when I call any virutal the webmail of iredmail always speaks to me.

Do you have config files for these web hosts under /etc/nginx/sites-enabled/ (and ends with '.conf')?



Yes I have
They are the 3 that I post here.
The default ones are .conf, the other one that I use for odoo is not, I named it only "odoo".
I had already tried with the name of odoo.conf and it did not work either

6

Re: Problems with configuration in nginx

ffrcaraballo wrote:

The default ones are .conf, the other one that I use for odoo is not, I named it only "odoo".
I had already tried with the name of odoo.conf and it did not work either

Please show us where the files are.

Note: Nginx only loads web host config files from /etc/nginx/sites-enabled/, is this the place you store config files for odoo web host?

When you run "nginx -t", does it report any error?

7

Re: Problems with configuration in nginx

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0 MARIADB
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: Debian GNU/Linux 10 (buster)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MARIADB
- Web server (Apache or Nginx): Nginx (difficult change from Apache for me :-(
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Not sure whether to add to an existing post or open a new one, I am stuck at the same point as ffrcaraballo
https://forum.iredmail.org/topic15142-p … nginx.html

On my iRedmail / nginx server mx.domain.com and domain.com I would like (as under apache previosuly) host a variety of php and other scripts in a number of (sub)directories. Other than https://domain.com/iredadmin/ everything seems however to redirect to https://domain.com/mail.

My nginx.conf is standard, I added a
/etc/sites-available/myOwnWeb.conf, add symlink, added webspace /var/www/html/htd/hallo.html

"# HTTPS
server {
    listen 443 ssl;
    server_name domain.com/htd;
##    index index.php index.html;
#    include /etc/nginx/templates/misc.tmpl;
#   include /etc/nginx/templates/ssl.tmpl;
  #  include /etc/nginx/templates/iredadmin.tmpl;
  #  include /etc/nginx/templates/roundcube.tmpl;
  #  include /etc/nginx/templates/sogo.tmpl;
  #  include /etc/nginx/templates/netdata.tmpl;
  #  include /etc/nginx/templates/php-catchall.tmpl;
  #  include /etc/nginx/templates/stub_status.tmpl;
    root /var/www/html/htd;
}"

I just took it from 00-default-ssl.conf, hoping it would give me my own webspace while keeping the roundcube mail and the iredadmin, but no luck. error.log "... server name "domain.com/htd" has suspicious symbols". Could anyone help me with my first nginx steps?

8

Re: Problems with configuration in nginx

boegenhold wrote:

    server_name domain.com/htd;

Domain name should not contain "/" at all.

9

Re: Problems with configuration in nginx

Understood, could you point to a tutorial on how to make websites work on the same server as iredmail please.

10

Re: Problems with configuration in nginx

I mean, in particular, where and how to remove the redirect to the roundcube mail

11

Re: Problems with configuration in nginx

boegenhold wrote:

I mean, in particular, where and how to remove the redirect to the roundcube mail

Check file /var/www/html/index.html.

12

Re: Problems with configuration in nginx

I am not sure how to open a new post, this is (maybe) unrelated to the previous

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0 MARIADB
- Deployed with iRedMail Easy or the downloadable installer? installer
- Linux/BSD distribution name and version: Debian GNU/Linux 10 (buster)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MARIADB
- Web server (Apache or Nginx): Nginx (difficult change from Apache for me :-(
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

over night, all icons on Roundcube have disappeared, I can still 'hover'  over them, will show the alternative text and work as well (compose email etc). How can I get the icons back.
apt-get install --reinstall roundcube-core did not help. I can't attach a screenshpt here.

13 (edited by caylak 2020-02-16 21:05:08)

Re: Problems with configuration in nginx

@boegenhold
can you try this

ln -s /etc/sites-available/myOwnWeb.conf /etc/sites-enabled/001-myOwnWeb.conf

nginx -t
nginx -s reload

14 (edited by caylak 2020-02-17 01:00:53)

Re: Problems with configuration in nginx

example virtualhost configuration.


os: ubuntu 18.04
iredmail server name: im.example.org
vhost domain: html.example.org


nano  /etc/nginx/sites-available/01-html.example.org.conf

 server {
        listen 80;
        listen [::]:80;

        root /srv/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        server_name html.example.org;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

        access_log /var/log/nginx/html.example.org-access.log;
        error_log /var/log/nginx/html.example.org-error.log;
}

save quit

ln -s /etc/nginx/sites-available/01-html.example.org.conf /etc/nginx/sites-enabled/01-html.example.org.conf
cd /srv
mkdir html
echo "iredmail nginx vhost" >html/index.html
chown -R www-data:www-data
nginx -t
nginx -s reload

15

Re: Problems with configuration in nginx

Did you try to empty web browser cache and check again?

16 (edited by vfxbro 2020-02-23 03:27:48)

Re: Problems with configuration in nginx

ZhangHuangbin wrote:

Did you try to empty web browser cache and check again?

I have the same problem!
when you go to the example.com domain, you are redirected to mail.example.com/mail/

I want my web-site worked on the primary domain example.com.
I have nginx.

How can this problem be solved?

17 (edited by caylak 2020-02-23 05:26:18)

Re: Problems with configuration in nginx

vfxbro wrote:

I have the same problem!
when you go to the example.com domain, you are redirected to mail.example.com/mail/

I want my web-site worked on the primary domain example.com.
I have nginx.

How can this problem be solved?

edit

 server_name _;

change

server_name orherdomain.com;
nginx -t
nginx -s reload

18

Re: Problems with configuration in nginx

Thx! I solved the problem so:
server block configuration file was created without the .conf extension

It was:
/etc/nginx/sites-available/domain.com

Has become:

/etc/nginx/sites-available/domain.com.conf