I am having some issues setting up two servers/virtual hosts on the same machine, I want ex1.example.com to direct to the first, and ex2.example.com to direct to the second (this is not the issue).
The first server is a bit complicated, proxying a waitress webserver, serving some static files, and uses basic auth for some urls - most importantly it requires ssl:
server {
listen 80;
listen [::]:80;
listen 443 ssl;
ssl on;
ssl_certificate /path/to/server.crt;
ssl_certificate_key /path/to/server.key;
# Make site accessible from http://localhost/
server_name ex1.example.com;
...
}
The second, ex2, is a simple setup, proxying an apache server and doesn't need ssl:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
# Make site accessible from http://ex2.example.com/
server_name ex2.example.com;
...
}
I have a similar setup running on an older ubuntu (precise) server (nginx version 1.1.19), where the above setup works fine.
On my ubuntu saucy server (nginx version 1.4.1) I have some serious issues, i hope someone can help.
Directing my browser to both http://ex1.example.com and http://ex2.example.com works fine - confirming that DNS is set up correctly for both.
Directing my browser to https://ex1.example.com gives me a "this website is not available" message in the browser, and no entries in the nginx error or access logs - this could be many things, but:
Directing a browser on the server to https://localhost gives the correct page! (I see what I expected to see when going to https://ex1.example.com except for an error with my ssl certificate not covering localhost, of course).
I am going crazy trying to debug this - has anyone got any suggestions?
Thank you in advance,
Mads
The first server is a bit complicated, proxying a waitress webserver, serving some static files, and uses basic auth for some urls - most importantly it requires ssl:
server {
listen 80;
listen [::]:80;
listen 443 ssl;
ssl on;
ssl_certificate /path/to/server.crt;
ssl_certificate_key /path/to/server.key;
# Make site accessible from http://localhost/
server_name ex1.example.com;
...
}
The second, ex2, is a simple setup, proxying an apache server and doesn't need ssl:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
# Make site accessible from http://ex2.example.com/
server_name ex2.example.com;
...
}
I have a similar setup running on an older ubuntu (precise) server (nginx version 1.1.19), where the above setup works fine.
On my ubuntu saucy server (nginx version 1.4.1) I have some serious issues, i hope someone can help.
Directing my browser to both http://ex1.example.com and http://ex2.example.com works fine - confirming that DNS is set up correctly for both.
Directing my browser to https://ex1.example.com gives me a "this website is not available" message in the browser, and no entries in the nginx error or access logs - this could be many things, but:
Directing a browser on the server to https://localhost gives the correct page! (I see what I expected to see when going to https://ex1.example.com except for an error with my ssl certificate not covering localhost, of course).
I am going crazy trying to debug this - has anyone got any suggestions?
Thank you in advance,
Mads