The entire site uses HTTPS, and only port 443 is open. However, it will be inaccessible when using http request, and the https protocol header must be added manually.
Is there any way to redirect http requests on port 80 to 443 to use https?
If you don’t have nginx, install it. If you want to enable http2, the version must be above 1.90, then configure port 443 first, and finally forward the http 80 port request to 443. For complete configuration, please refer to the configuration of my blog below:
If you don’t have nginx, install it. If you want to enable http2, the version must be above 1.90, then configure port 443 first, and finally forward the http 80 port request to 443. For complete configuration, please refer to the configuration of my blog below:
The first plan>
Second plan>
Write two configurations
Port 80 jumps directly to 443
server {
listen 80;
server_name your domain name;
rewrite ^(.*)$ https://$host$1 permanent;
}