0

I'm running with nginx in port 81 and apache in port 80. I tried to put ssl certificate in nginx. It's not woking.

Here is my nginx's default:

server{
listen  81;
listen 443 ssl;

 server_name 35.154.225.46;
 ssl_certificate /etc/nginx/ssl/nginx.crt;
 ssl_certificate_key /etc/nginx/ssl/nginx.key;

 location / {
    proxy_pass http://localhost:8080;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
  }
}

I created ssl certificate by following this tutorial: How To Create an SSL Certificate on Nginx for Ubuntu 14.04

Edit: Before I was tried to use SSL. I was using nginx [node js] at port 81 and apache [php] at port 80. Now I tried to use SSL in nginx. Now Nginx is working in default port [80] with ssl and apache is not working. I want both server should run.

15
  • define not working. What is the error message you get when you try to connect to the server? May 5, 2017 at 13:51
  • @GeraldSchneider This site can’t provide a secure connection May 5, 2017 at 14:09
  • Thats a protocol error. Are you using SHA1?
    – mzhaase
    May 5, 2017 at 14:12
  • @mzhaase ERR_SSL_PROTOCOL_ERROR May 5, 2017 at 14:13
  • It works for me, I just get untrusted CA error, because it is self-signed.
    – mzhaase
    May 5, 2017 at 14:16

1 Answer 1

1

You configured Port 441 for ssl. Port 81 is still configured to use http. If you try to connect to your port 81 with https, you get the protocol error because the server talks plain http, but the client expects an ssl response.

If you want to use ssl on the port 81 you have to add the ssl keyword.

listen 81 ssl;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .