Answer the question
In order to leave comments, you need to log in
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
Make two server sections listening on different ports: one with SSL (443), one without (80).
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 questionAsk a Question
731 491 924 answers to any question