Certificate error with two servers at the same IP

Greetings. I am working on projects from home. Since this is at home, it's a regular cable modem to wireless router arrangement. External ports 80 and 443 and port forwarded in the router to the internal IP of the linux webserver 192.168.1.100.

I also need to share project files back and forth with colleagues. Owncloud comes as a virtual machine appliance that is entirely self contained and runs under Oracle VirtualBox -- 192.168.1.200 on the same computer that is the web server.

I tried using ownCloud's Let's Encrypt module to specify owncloud.mydomain.com. I have the DNS record set up with a CNAME of owncloud.mydomain.com to point to the IP address of my house. Since ports 80 and 443 are already being used by a Linux webserver at my house, I set up the router to redirect incoming Port 121 traffic to the virtual machine's Port 443 (192.168.1.200).
I can reach the ownCloud server at https://owncloud.mydomain.com:121 but the browser says:

"Your connection is not private
Attackers might be trying to steal your information from owncloud.stellar7.space (for example, passwords, messages, or credit cards). Learn more
NET::ERR_CERT_COMMON_NAME_INVALID"

So how do I get HTTPS with 2 different domains, accessing two different computers with 2 different LAN IPs at the same cable modem/router?

Thanks!

www.mydomain.com:80,443 ---> home IP --> router --> 192.168.1.100 (80,443 - webserver)
owncloud.mydomain.com:121 --> home IP --> router --> 192.168.1.200 (443 - owncloud https)

In order for both to pass HTTP validation, you will need to direct requests to there expected end points.
This can be done via proxy.

[OR choose another authentication method - like: DNS]

1 Like

I think I got it working by changing the router's port forwarding by temporarily switching the direction of Ports 80 and 443 from the webserver (192.168.1.100) to the OwnCloud appliance (192.168.1.200), then running the Let's Encrypt plugin. When I changed the router back to sending Port 80 and 443 back to the webserver (192.168.1.100) and added a routing of Port 200 to 443 at the Appliance's IP (192.168.1.200), I can now access ownCloud securely via https://mydomain.com:200/

Will I need to renew the certificate every 3 months manually by temporarily changing the port mappings to expose the ownCloud appliance to ports 80 and 443?

Yes, but either of @rg305's suggestions would enable you to avoid this fate.

Setting up a reverse proxy behind your router is a good solution also because it also means that you don't need to pick different external ports for your appliances; everything can share 80/443 externally, and then internally you'd proxy the appropriate internal host by hostname.

1 Like

I don't really know anything about networking. What proxy solution would you recommend?

You could set up a virtual machine that runs the nginx web server - that's very popular and Certbot has native support for it.

Let's say, you install it on a new, small virtual machine at 192.168.1.300.

You'd configure nginx to proxy for your two domains:

server {
  listen 80;
  server_name mydomain.com
  location / {
    proxy_pass http://192.168.1.100;
  }
}

server {
  listen 80;
  server_name owncloud.mydomain.com
  location / {
    proxy_pass http://192.168.1.200;
  }
}

and you'd point external ports 80 and 443 towards 192.168.1.300:80 and 192.168.1.300:443, respectively.

You could then set some certificates up (on this proxy VM):

certbot --nginx -d mydomain.com
certbot --nginx -d owncloud.mydomain.com

and from there, you can access https://owncloud.mydomain.com and https://mydomain.com directly, without needing to specify alternate ports. Certificate renewal will also be automatic and won't require any human intervention.

That's an abridged version, but there's a bunch of great "nginx + reverse proxy" tutorials out there.

I can't stop laughing from that one !

3 Likes

Yeah I can't figure out why it didn't work. 2^8 = 300

2 Likes

LMAO sorry, I really didn't realize.

5 Likes

2^8.22881869 = 300
LOL

4 Likes

It took a while but I finally got a Linux VM running with NGINX (I'll just call it NGINX for brevity henceforth). I've tried researching reverse proxies but something is still off and I'm not sufficiently knowledgeable of how all of this works:

  • Router is directing all Port 80 and 443 traffic to NGINX.
  • NGINX is at 192.168.1.120
  • NGINX is pingable from any computer within the LAN.
  • Owncloud appliance VM is at 192.168.1.121.
  • My main Linux Apache webserver has 2 websites: (192.168.1.227)
    1. mno.org
    2. s7.org
  • When I try to access either https://mno.org or https://s7.org, they go to:
    1. mno.org --> "Welcome to nginx!"
    2. s7.org --> mno.org

What did I configure improperly? Oh and I did execute Let's Encrypt per your instructions. It did change a few entries.

nginx.cfg (domains changed to protect the innocent)

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss t$
        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;

#added by Jones
server {
  listen 80;
  server_name s7.space;
  location / {
    proxy_pass http://129.168.1.121;
  }
}
server {
  listen 80;
  server_name owncloud.s7.space;
  location / {
    proxy_pass http://129.168.1.121;
  }
}

server {
  listen 80;
  listen 443 ssl;
  server_name s7.org;
  location / {
    proxy_pass http://192.168.1.227;
  }

    ssl_certificate /etc/letsencrypt/live/s7.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/s7.org/privkey.pem; # managed by Certbot
}

server {
  listen 80;
  listen 443 ssl;
  server_name mno.org;
  location / {
    proxy_pass http://192.168.1.227;
  }

    ssl_certificate /etc/letsencrypt/live/mno.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mno.org/privkey.pem; # managed by Certbot
}



server {
    if ($host = s7.org) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  listen 80;
  server_name s7.org;
    return 404; # managed by Certbot


}

server {
    if ($host = mno.org) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  listen 80;
  server_name mno.org;
    return 404; # managed by Certbot


}}

#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
#
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}

You should not set vhost configs to listen to both 80 & 443.

Apart from the duplicate 80 virtual hosts, I think these are probably fine. Certbot's nginx installer joins them automatically if you choose not to enable redirects.

But if you want the HTTP->HTTPS redirects to apply, it's best to remove the port 80 from those dual 80/443 vhosts.

That config looks like it should work just fine for those two domains.

Is nginx definitely reloaded?

sudo nginx -t
sudo nginx -s reload

I removed the lines referencing 443 and now:

  • mno.org connects securely to nginx but shows "welcome to nginx!" instead of the mno.org on the other server.
  • s7.org seems to forward to mno.org, showing "welcome to nginx!".

It doesn't seem to be redirecting traffic to the other linux apache server, which btw was already set up with Let's Encrypt to accept HTTPS traffic. It's configured with multiple sites.

I guess I wasn't reloading it properly. But it's saying:

nginx: [warn] conflicting server name "mno.org" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "s7.org" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "mno.org" on 0.0.0.0:80, ignored

Should that location / { proxy_pass statement be moved into where Let's Encrypt created an entry?

If you followed @rg305's earlier advice, I'm not sure why you would be seeing those duplicate warnings.

What's the full output of nginx's config; not just that file:

sudo nginx -T
nginx: [warn] conflicting server name "mno.org" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "s7.org" on 0.0.0.0:80, ignored
nginx: [warn] conflicting server name "mno.org" on 0.0.0.0:80, ignored
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
		
		server {
  listen 80;
  server_name s7.space;
  location / {
    proxy_pass http://129.168.1.121;
  }
}
server {
  listen 80;
  server_name owncloud.s7.space;
  location / {
    proxy_pass http://129.168.1.121;
  }
}

server {
  server_name s7.org;
  location / {
    proxy_pass http://192.168.1.227;
  }

    ssl_certificate /etc/letsencrypt/live/s7.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/s7.org/privkey.pem; # managed by Certbot
}

server {
  server_name mno.org;
  location / {
    proxy_pass http://192.168.1.227;
  }

    ssl_certificate /etc/letsencrypt/live/mno.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mno.org/privkey.pem; # managed by Certbot
}



server {
    if ($host = s7.org) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  listen 80;
  server_name s7.org;
    return 404; # managed by Certbot


}

server {
    if ($host = mno.org) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  listen 80;
  server_name mno.org;
    return 404; # managed by Certbot


}}


#mail {
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
#
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}


# configuration file /etc/nginx/modules-enabled/50-mod-http-image-filter.conf:
load_module modules/ngx_http_image_filter_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-xslt-filter.conf:
load_module modules/ngx_http_xslt_filter_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-mail.conf:
load_module modules/ngx_mail_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-stream.conf:
load_module modules/ngx_stream_module.so;

# configuration file /etc/nginx/mime.types:

types {
    text/html                             html htm shtml;
    text/css                              css;
    text/xml                              xml;
    image/gif                             gif;
    image/jpeg                            jpeg jpg;
    application/javascript                js;
    application/atom+xml                  atom;
    application/rss+xml                   rss;

    text/mathml                           mml;
    text/plain                            txt;
    text/vnd.sun.j2me.app-descriptor      jad;
    text/vnd.wap.wml                      wml;
    text/x-component                      htc;

    image/png                             png;
    image/tiff                            tif tiff;
    image/vnd.wap.wbmp                    wbmp;
    image/x-icon                          ico;
    image/x-jng                           jng;
    image/x-ms-bmp                        bmp;
    image/svg+xml                         svg svgz;
    image/webp                            webp;

    application/font-woff                 woff;
    application/java-archive              jar war ear;
    application/json                      json;
    application/mac-binhex40              hqx;
    application/msword                    doc;
    application/pdf                       pdf;
    application/postscript                ps eps ai;
    application/rtf                       rtf;
    application/vnd.apple.mpegurl         m3u8;
	
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript


    application/vnd.ms-excel              xls;
    application/vnd.ms-fontobject         eot;
    application/vnd.ms-powerpoint         ppt;
    application/vnd.wap.wmlc              wmlc;
    application/vnd.google-earth.kml+xml  kml;
    application/vnd.google-earth.kmz      kmz;
    application/x-7z-compressed           7z;
    application/x-cocoa                   cco;
    application/x-java-archive-diff       jardiff;
    application/x-java-jnlp-file          jnlp;
    application/x-makeself                run;
    application/x-perl                    pl pm;
    application/x-pilot                   prc pdb;
    application/x-rar-compressed          rar;
    application/x-redhat-package-manager  rpm;
    application/x-sea                     sea;
    application/x-shockwave-flash         swf;
    application/x-stuffit                 sit;
    application/x-tcl                     tcl tk;
    application/x-x509-ca-cert            der pem crt;
    application/x-xpinstall               xpi;
    application/xhtml+xml                 xhtml;
    application/xspf+xml                  xspf;
    application/zip                       zip;

    application/octet-stream              bin exe dll;
    application/octet-stream              deb;
    application/octet-stream              dmg;
    application/octet-stream              iso img;
    application/octet-stream              msi msp msm;

    application/vnd.openxmlformats-officedocument.wordprocessingml.document    docx;
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet          xlsx;
    application/vnd.openxmlformats-officedocument.presentationml.presentation  pptx;

    audio/midi                            mid midi kar;
    audio/mpeg                            mp3;
    audio/ogg                             ogg;
    audio/x-m4a                           m4a;
    audio/x-realaudio                     ra;

    video/3gpp                            3gpp 3gp;
    video/mp2t                            ts;
    video/mp4                             mp4;
    video/mpeg                            mpeg mpg;
    video/quicktime                       mov;
    video/webm                            webm;
    video/x-flv                           flv;
    video/x-m4v                           m4v;
    video/x-mng                           mng;
    video/x-ms-asf                        asx asf;
    video/x-ms-wmv                        wmv;
    video/x-msvideo                       avi;
}


# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made

# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
        listen 80 default_server;
        listen [::]:80 default_server;

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /var/www/html;

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

        server_name _;

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

        # pass PHP scripts to FastCGI server
        #
        #location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php-fpm (or other unix sockets):
        #       fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass 127.0.0.1:9000;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#       listen 80;
#       listen [::]:80;
#
#       server_name example.com;
#
#       root /var/www/example.com;
#       index index.html;
#
#       location / {
#               try_files $uri $uri/ =404;
#       }
#}

server {

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;
    server_name mno.org; # managed by Certbot


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

        # pass PHP scripts to FastCGI server
        #
        #location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php-fpm (or other unix sockets):
        #       fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass 127.0.0.1:9000;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}


    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/mno.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mno.org/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server {
    if ($host = mno.org) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        listen 80 ;
        listen [::]:80 ;
    server_name mno.org;
    return 404; # managed by Certbot


}
# configuration file /etc/letsencrypt/options-ssl-nginx.conf:
# This file contains important security parameters. If you modify this file
# manually, Certbot will be unable to automatically provide future security
# updates. Instead, Certbot will print and log an error message with a path to
# the up-to-date file that you will need to refer to when manually updating
# this file.

ssl_session_cache shared:le_nginx_SSL:10m;
ssl_session_timeout 1440m;
ssl_session_tickets off;

ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;

ssl_ciphers "replaced..................";

Was there another line between these two lines, in the output originally? Assuming there was, and that missing line was:

# configuration file /etc/nginx/sites-enabled/default:

Then I think you should be able to:


sudo rm /etc/nginx/sites-enabled/default

and then:

Delete this.


Add these lines inside:

listen 443 ssl;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

Add those same lines there.


and then try reload nginx.

  • Directory deleted.
  • Yes, that line was missing because I was cutting/pasting one screen at a time but the dump below now shows everything after changes, in one continuous copy/paste.
  • I reloaded nginx per previous instruction.
  • When I try to visit https://mno.org it says "mno.org redirected you too many times."
  • https://s7.org redirects to https://mno.org and does the preceding bullet.
  • Did I properly effect all the changes you stated? (sudo nginx -T below)
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;

#added by WebGuy
#server {
#  listen 80;
#  server_name s7.space;
#  location / {
#    proxy_pass http://129.168.1.121;
#  }
#}
server {
  listen 80;
  server_name owncloud.s7.space;
  location / {
    proxy_pass http://129.168.1.121;
  }
}

server {
  server_name s7.org;
  listen 443 ssl;
  include /etc/letsencrypt/options-ssl-nginx.conf;  # added
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;  # added
  location / {
    proxy_pass http://192.168.1.227;
  }

    ssl_certificate /etc/letsencrypt/live/s7.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/s7.org/privkey.pem; # managed by Certbot
}

server {
  server_name mno.org;
  listen 443 ssl;
  include /etc/letsencrypt/options-ssl-nginx.conf;  # added
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;  # edded
  location / {
    proxy_pass http://192.168.1.227;
  }

    ssl_certificate /etc/letsencrypt/live/mno.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/mno.org/privkey.pem; # managed by Certbot
}



server {
    if ($host = s7.org) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  listen 80;
  server_name s7.org;
    return 404; # managed by Certbot


}

server {
    if ($host = mno.org) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


  listen 80;
  server_name mno.org;
    return 404; # managed by Certbot


}}


#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
#
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}


# configuration file /etc/nginx/modules-enabled/50-mod-http-image-filter.conf:
load_module modules/ngx_http_image_filter_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-http-xslt-filter.conf:
load_module modules/ngx_http_xslt_filter_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-mail.conf:
load_module modules/ngx_mail_module.so;

# configuration file /etc/nginx/modules-enabled/50-mod-stream.conf:
load_module modules/ngx_stream_module.so;

# configuration file /etc/nginx/mime.types:

types {
    text/html                             html htm shtml;
    text/css                              css;
    text/xml                              xml;
    image/gif                             gif;
    image/jpeg                            jpeg jpg;
    application/javascript                js;
    application/atom+xml                  atom;
    application/rss+xml                   rss;

    text/mathml                           mml;
    text/plain                            txt;
    text/vnd.sun.j2me.app-descriptor      jad;
    text/vnd.wap.wml                      wml;
    text/x-component                      htc;

    image/png                             png;
    image/tiff                            tif tiff;
    image/vnd.wap.wbmp                    wbmp;
    image/x-icon                          ico;
    image/x-jng                           jng;
    image/x-ms-bmp                        bmp;
    image/svg+xml                         svg svgz;
    image/webp                            webp;

    application/font-woff                 woff;
    application/java-archive              jar war ear;
    application/json                      json;
    application/mac-binhex40              hqx;
    application/msword                    doc;
    application/pdf                       pdf;
    application/postscript                ps eps ai;
    application/rtf                       rtf;
    application/vnd.apple.mpegurl         m3u8;
    application/vnd.ms-excel              xls;
    application/vnd.ms-fontobject         eot;
    application/vnd.ms-powerpoint         ppt;
    application/vnd.wap.wmlc              wmlc;
    application/vnd.google-earth.kml+xml  kml;
    application/vnd.google-earth.kmz      kmz;
    application/x-7z-compressed           7z;
    application/x-cocoa                   cco;
    application/x-java-archive-diff       jardiff;
    application/x-java-jnlp-file          jnlp;
    application/x-makeself                run;
    application/x-perl                    pl pm;
    application/x-pilot                   prc pdb;
    application/x-rar-compressed          rar;
    application/x-redhat-package-manager  rpm;
    application/x-sea                     sea;
    application/x-shockwave-flash         swf;
    application/x-stuffit                 sit;
    application/x-tcl                     tcl tk;
    application/x-x509-ca-cert            der pem crt;
    application/x-xpinstall               xpi;
    application/xhtml+xml                 xhtml;
    application/xspf+xml                  xspf;
    application/zip                       zip;

    application/octet-stream              bin exe dll;
    application/octet-stream              deb;
    application/octet-stream              dmg;
    application/octet-stream              iso img;
    application/octet-stream              msi msp msm;

    application/vnd.openxmlformats-officedocument.wordprocessingml.document    docx;
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet          xlsx;
    application/vnd.openxmlformats-officedocument.presentationml.presentation  pptx;

    audio/midi                            mid midi kar;
    audio/mpeg                            mp3;
    audio/ogg                             ogg;
    audio/x-m4a                           m4a;
    audio/x-realaudio                     ra;

    video/3gpp                            3gpp 3gp;
    video/mp2t                            ts;
    video/mp4                             mp4;
    video/mpeg                            mpeg mpg;
    video/quicktime                       mov;
    video/webm                            webm;
    video/x-flv                           flv;
    video/x-m4v                           m4v;
    video/x-mng                           mng;
    video/x-ms-asf                        asx asf;
    video/x-ms-wmv                        wmv;
    video/x-msvideo                       avi;
}

# configuration file /etc/letsencrypt/options-ssl-nginx.conf:
# This file contains important security parameters. If you modify this file
# manually, Certbot will be unable to automatically provide future security
# updates. Instead, Certbot will print and log an error message with a path to
# the up-to-date file that you will need to refer to when manually updating
# this file.

ssl_session_cache shared:le_nginx_SSL:10m;
ssl_session_timeout 1440m;
ssl_session_tickets off;

ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;

ssl_ciphers "----------";

Is it correct that mno.org and s7.org have the same proxy_pass IP address? If so, you might want to add this just above the proxy_pass lines:

proxy_set_header Host $host;

(Edit: actually, do this in any case. It's just better).

Other than that, this looks good.

Ah, good point.

You will want to get rid of the HTTP-to-HTTPS redirect on your other webservers now. This is because HTTPS is now handled at the nginx proxy rather than on each of the internal webservers.

What are you running on those? Apache?