Home > OS >  The plain HTTP request was sent to HTTPS portnginx problem
The plain HTTP request was sent to HTTPS portnginx problem

Time:11-10

Before using the 443 port configuration domain name, use port access directly without using certificate

Do after small programs need to configure HTTPS, configuration before 443 cannot be accessed after the show:

400 The plain HTTP request was sent to HTTPS portnginx


443 configuration below
Server
{
listen 443;
# listen [: :] : 80;
Server_name A.A.C n;
Index index. HTML index. HTM index. The default PHP, HTML default. HTM. Default PHP;
Root/home/project/test/test;

The include rewrite/thinkphp. Conf;
404/404 # error_page. HTML;

# to Deny access to the PHP files in specific directory
# the location ~/(wp - content | uploads | wp - includes | images)/. * \. PHP ${deny all; }

Include the enable - PHP. Conf.

The location ~. * \. (GIF | JPG | jpeg | PNG | BMP | SWF) $
{
Expires 30 d;
}

The location ~. * \. (js) | CSS? $
{
Expires 12 h;
}

The location ~/. Well - known {
Allow all;
}

The location ~/\.
{
Deny all;
}

Access_log off;
}

HTTPS configuration is as follows:
Server
{
listen 443 ssl;
# listen [: :] : 80;
Server_name B.B.C n;
Index index. HTML index. HTM index. PHP;
Root/home/laravel/test/test;

The include rewrite/laravel. Conf;
404/404 # error_page. HTML;

# to Deny access to the PHP files in specific directory
# the location ~/(wp - content | uploads | wp - includes | images)/. * \. PHP ${deny all; }

Include the enable - php7.2. Conf.


Ssl_certificate cert/4544928 _b. The biggest Nancy (polocy) pelosi em; # the domain name. Pem replace your certificate file name,
Ssl_certificate_key cert/4544928 _b. The biggest n.k ey. # the domain name. The key to replace your key certificate file name,
ssl_session_timeout 5m;
Ssl_ciphers ECDHE - RSA - either AES128 - GCM - SHA256: ECDHE: ECDH: AES: HIGH:! NULL:! aNULL:! MD5:! ADH:! RC4.
Ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;


The location ~. * \. (GIF | JPG | jpeg | PNG | BMP | SWF) $
{
Expires 30 d;
}

The location ~. * \. (js) | CSS? $
{
Expires 12 h;
}

The location ~/. Well - known {
Allow all;
}

The location ~/\.
{
Deny all;
}

Access_log off;
}

HTTPS can normal visit
But not accessed through port 443

  • Related