Table of Contents
1. Log in to Alibaba Cloud or Tencent Cloud and other domain name controllers to download the free certificate
2. Click nginx to download and upload it to the server
3. nginx configuration https protocol
Home Operation and Maintenance Nginx How to configure nginx https 443 port

How to configure nginx https 443 port

May 21, 2023 pm 04:40 PM
nginx https

1. Log in to Alibaba Cloud or Tencent Cloud and other domain name controllers to download the free certificate

How to configure nginx https 443 port

2. Click nginx to download and upload it to the server

How to configure nginx https 443 port

3. nginx configuration https protocol

   server {
      listen  443 ssl;
    server_name xxx.com;
        ssl_certificate cert/下载的pem后缀文件;
        ssl_certificate_key cert/下载的key后缀文件;
        ssl_session_timeout 120m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
        ssl_prefer_server_ciphers on;
 
        location / {
         proxy_pass http://转发的路径(跟http一致)/;
         #proxy_set_header X-Real-IP $remote_addr;
         #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         #proxy_set_header Host $http_host;
         #proxy_set_header X-NginX-Proxy true;
        
 
     #由于nginx的反向代理,所以需要在这里将$remote_addr赋值给某一参数,系统通过该参数获取用户的访问ip,这里直接定义为:WL-Proxy-Client-IP
     proxy_set_header            WL-Proxy-Client-IP $remote_addr;
         proxy_redirect default;    
    }
 
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
   }
Copy after login

Now nginx configuration https is completed. If the configuration does not take effect, please check whether the path of the downloaded pem and key files is correct

Execute the nginx restart command: systemctl restart nginx.service to apply

The above is the detailed content of How to configure nginx https 443 port. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to allow external network access to tomcat server How to allow external network access to tomcat server Apr 21, 2024 am 07:22 AM

How to allow external network access to tomcat server

What are the nginx start and stop commands? What are the nginx start and stop commands? Apr 02, 2024 pm 08:45 PM

What are the nginx start and stop commands?

How to run thinkphp How to run thinkphp Apr 09, 2024 pm 05:39 PM

How to run thinkphp

Welcome to nginx!How to solve it? Welcome to nginx!How to solve it? Apr 17, 2024 am 05:12 AM

Welcome to nginx!How to solve it?

How to register phpmyadmin How to register phpmyadmin Apr 07, 2024 pm 02:45 PM

How to register phpmyadmin

How to deploy nodejs project to server How to deploy nodejs project to server Apr 21, 2024 am 04:40 AM

How to deploy nodejs project to server

How to solve the problem of nginx when accessing the website How to solve the problem of nginx when accessing the website Apr 02, 2024 pm 08:39 PM

How to solve the problem of nginx when accessing the website

How to communicate between docker containers How to communicate between docker containers Apr 07, 2024 pm 06:24 PM

How to communicate between docker containers

See all articles