I'm trying to put a server@home in place with some basic services. All services run into a dedicated VM. Each VM is hosted on vSphere 5.5. So far I have :
- Debian wheezy with nginx used as a reverse proxy : 192.168.1.12
- Debian wheezy with nodeJS used as a webapp server : 192.168.1.43
- 192.168.1.43:3000 => http web server that makes a redirection on 192.168.1.43:3001
- 192.168.1.43:3001 => https web server that makes provides the service
- Debian wheezy with madsonic installed : 192.168.1.35
- As said in documentation I put --https-port=443 in the config to enable https access
I use nginx to be able to have things like this :
- myapp.mydomaine.com => go to nodejs @ 192.168.1.43
- music.mydomain.com => go to madsonic @ 192.168.1.35
I followed a tutorial and edited the "default" file in /etc/nginx/sites-enabled. Here is how it looks like :
server {
listen 80;
server_name myapp.domaine.com;
location / {
proxy_pass http://192.168.1.43:3000;
}
}
server {
listen 443;
server_name myapp.domain.com;
ssl on;
ssl_certificate [...];
ssl_certificate_key [...];
location / {
proxy_pass https://192.168.1.43:3001;
}
}
server {
listen 80;
server_name music.domain.com;
location / {
proxy_pass http://192.168.1.35:4040;
}
}
server {
listen 443;
server_name music.domain.com;
ssl on;
ssl_certificate [...];
ssl_certificate_key [...];
location / {
proxy_pass https://192.168.1.35;
}
}
The first redirection on myapp works. The redirection on music works when I had only http on the madsonic server. When I activate https on madsonic server I get a 502 Bad gateway error (but the URL in Firefox is https://music.domain.com).
I also tryed :
server {
listen 80;
server_name music.domain.com;
return 301 https//:192.168.1.35;
}
Did not work either. I have no idea where it might comes from. Someone has a suggestion ? Thanks very much.
P.S: sorry if my English is not perfect. I did my best :-s