Dealing with nginx 400 “The plain HTTP request was sent to HTTPS port” error

后端 未结 8 985
不思量自难忘°
不思量自难忘° 2020-11-28 02:04

I\'m running a Sinatra app behind passenger/nginx. I\'m trying to get it to respond to both http and https calls. The problem is, when both are defined in the server block h

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-28 02:58

    I ran into a similar problem. It works on one server and does not on another server with same Nginx configuration. Found the the solution which is answered by Igor here http://forum.nginx.org/read.php?2,1612,1627#msg-1627

    Yes. Or you may combine SSL/non-SSL servers in one server:

    server {
      listen 80;
      listen 443 default ssl;
    
      # ssl on   - remember to comment this out
    
    }
    

提交回复
热议问题