Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Nginx compilation and installation-support for https

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Server environment * *

System: CentOS 6.5

Pcre-8.39

Zlib-1.2.11

Openssl-1.1.0c

Nginx-1.10.2

*

1. Prepare dependency packages and necessary components

Click (here) to collapse or open

Yum install gcc,gcc-c++

Pcre

Cd / home/nginx/pcre-8.39

. / configure

Make

Make install

Zlib

Cd zlib-1.2.11

. / configure

Make

Make install

Openssl

Cd openssl-1.1.0c

. / config

Make

Make install

2. Install nginx

Click (here) to collapse or open

Cd nginx-1.10.2

. / configure-- conf-path=/usr/local/nginx/nginx.conf\

-- pid-path=/usr/local/nginx/nginx.pid\

-- with-http_ssl_module\

-- with-pcre=/home/nginx/pcre-8.39\

-- with-zlib=/home/nginx/zlib-1.2.11\

-- with-openssl=/home/nginx/openssl-1.1.0c\

-- sbin-path=/usr/local/nginx

Make

Make install3, configure nginx

Click (here) to collapse or open

Gzip on; # enable Compression

Location / zxq/ {

Host address port for the proxy_pass http://172.16.69.208:8080/; # service

Proxy_cookie_path / / zxq/; # configure session hold

Proxy_set_header X-Real-IP $remote_addr; # increase the actual client IP address

Proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # increase the actual client IP address

Access_log logs/access.logzxq; # configure log path

Keepalive_timeout 0; # http connection timeout

Proxy_read_timeout 120

Expires 5m

} other parameters:

Proxy_connect_timeout

Timeout of backend server connection _ initiating handshake waiting for response timeout

Proxy_read_timeout

After the connection is successful, _ waiting for the response time of the backend server _ has actually entered the queue of the backend for processing (it can also be said that the time it takes for the backend server to process the request)

Proxy_send_timeout

Backend server data return time _ that is, within a specified time, the backend server must transmit all the data.

4. Related instructions

# nginx-s reload # reload configuration file

# nginx-s reopen # reopen log files, etc. 5. Other configurations

The page of 40450x can be customized. Just put the finished html file into the html folder under the nginx installation directory.

Specific configuration

Error_page 404 / 404.html

# redirect server error pages to the static page / 50x.html

#

Error_page 500 502 503 504 / 50x.html

Location = / 50x.html {

Root html

}

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report