M
M
Mark Rosenthal2015-11-21 13:53:46
Nginx
Mark Rosenthal, 2015-11-21 13:53:46

Bad request in Nginx?

Hello!
Nginx stops, a 400 error occurs when accessing http. The advice from stackoverflow didn't work.
I want: so that when accessing http, nginx sends to https.
Problem: it turns out to be done either via http or https.
If 443 works, on port 80 Bad Request. If 80 works, SSL has to be cut down.
It's easier to see a hundred times. Who cares, throw in the block server configs (those in sites-available)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
neol, 2015-11-21
@neol

Make two server sections listening on different ports: one with SSL (443), one without (80).

I
Igor Alyakimov, 2015-11-21
@kaiten

In the server directive, specify two listen directives:
Listen 80;
Listen 443 ssl;
Use ssl on; not needed in this case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question