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

后端 未结 8 986
不思量自难忘°
不思量自难忘° 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:56

    I had the exact same issue, I have kind of the same configuration as your exemple and I got it working by removing the line :

    ssl on;

    To quote the doc:

    If HTTP and HTTPS servers are equal, a single server that handles both HTTP and HTTPS requests may be configured by deleting the directive “ssl on” and adding the ssl parameter for *:443 port

提交回复
热议问题