Centos7.3 How to install and deploy Nginx and configure https

Centos7.3 How to install and deploy Nginx and configure https

Installation Environment

1. gcc installation

To install nginx, you need to compile the source code downloaded from the official website first

Compilation depends on the gcc environment:

yum install gcc-c++

2. PCRE pcre-devel installation

Install pcre-devel, which is a secondary development library developed using pcre. :

yum install -y pcre pcre-devel

3. zlib Installation

The zlib library provides many ways of compression and decompression. Nginx can use zlib to gzip the contents of http packets:

yum install -y zlib zlib-devel

4. OpenSSL Installation

A powerful secure socket layer cryptographic library that includes major cryptographic algorithms, commonly used key and certificate package management functions, and SSL protocols. Nginx needs to support https (transmit http over ssl protocol)

yum install -y openssl openssl-devel

Install Nginx

Download using wget command

wget -c https://nginx.org/download/nginx-1.9.9.tar.gz

Unzip

tar -zxvf nginx-1.9.9.tar.gz
cd nginx-1.9.9/

Configuration

Common configuration

#./configure

Configure https:

./configure --with-http_ssl_module

Install

make
make install

Find the installation path:

whereis nginx

Start and stop nginx

cd /usr/local/nginx/sbin/
./nginx
./nginx -s stop
./nginx -s quit
./nginx -s reload

Notes:

./nginx -t: Check whether the nginx.conf configuration file is correct

./nginx -s quit: This method stops the nginx process after it has completed its processing tasks.

./nginx -s stop: This method is equivalent to first finding out the nginx process ID and then using the kill command to forcibly kill the process.

To configure SSL, please check which server you are using and apply for an SSL certificate when applying for a domain name, and then configure it directly in the server load balancing.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Detailed process of configuring Https certificate under Nginx
  • Nginx configures the same domain name to support both http and https access
  • Detailed configuration of Nginx supporting both Http and Https
  • Nginx domain name SSL certificate configuration (website http upgraded to https)
  • How to configure SSL certificate in nginx to implement https service
  • Detailed explanation of Frp forced redirection to https configuration under Nginx
  • How to install nginx in docker and configure access via https
  • Detailed explanation of nginx using ssl module configuration to support HTTPS access
  • Nginx implements https website configuration code example

<<:  The role of MySQL 8's new feature window functions

>>:  js implements a simple shopping cart module

Recommend

Detailed steps for deploying Microsoft Sql Server with Docker

Table of contents 1 Background 2 Create a contain...

How to use MySQL stress testing tools

1. MySQL's own stress testing tool - Mysqlsla...

MySQL data loss troubleshooting case

Table of contents Preface On-site investigation C...

How to reset Zabbix password (one-step)

Problem Description Since we don't log in to ...

Detailed explanation of the frame and rules attributes of the table in HTML

The frame and rules attributes of the table tag c...

Detailed explanation of docker version es, milvus, minio startup commands

1. es startup command: docker run -itd -e TAKE_FI...

React's method of realizing secondary linkage

This article shares the specific code of React to...

JavaScript object-oriented implementation of magnifying glass case

This article shares the specific code of JavaScri...

Detailed tutorial on installing nacos in docker and configuring the database

Environment Preparation Docker environment MySQL ...

Tomcat source code analysis of Web requests and processing

Table of contents Preface 1. EndPoint 2. Connecti...

How to turn a jar package into a docker container

How to turn a jar package into a docker container...

Use image to submit the form instead of using button to submit the form

Copy code The code is as follows: <form method...

What you need to know about responsive design

Responsive design is to perform corresponding ope...

Analysis of the principles of docker containers

Table of contents 01 What is the essence of a con...

Use of Linux relative and absolute paths

01. Overview Absolute paths and relative paths ar...