M
M
My joy2017-06-23 22:31:46
Nginx
My joy, 2017-06-23 22:31:46

Nginx - how to keep http available over https?

Friends!
On the site ssl, but there was a need for it to be available and just via http.
In the config I wrote this:

server {
  listen 80;
  listen 443 ssl;
  ...

But when I try to access the page, I get a fig from nginx:
400 Bad Request
The plain HTTP request was sent to HTTPS port
Where did I screw up?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
My joy, 2017-06-23
@t-alexashka

Understood. It should have been written like this:

...
listen 443 default ssl;
...

And comment below
If you, like me, have http / https combined into one server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question