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

How to solve the problem that nginx does not recognize ssl

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article introduces the relevant knowledge of "how to solve the problem that nginx can not recognize ssl". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

A [emerg] unknown directive "ssl" in nginx.conf exception occurred in the configuration ssl today.

Configure the ssl module in nginx, enter the nginx installation directory sbin, and execute the command. / nginx-t has a "nginx: [emerg] unknown directive" ssl "in / usr/local/nginx/conf/nginx.conf" exception. This article summarizes the solutions to this exception.

From the hint of this exception, we conclude that the ssl module is currently missing from nginx.

Let's download the openssl file first. Download address: https://www.openssl.org/source/openssl-1.0.2l.tar.gz

Put the downloaded package in the nginx installation directory.

Execute the following extract command:

Tar-xvzf openssl-1.0.2l.tar.gz

Enter the unzipped directory:

Cd openssl-1.0.2l

Set the (--prefix) parameter for Openssl installation to the directory you want to install, that is, the files after installation will appear in this directory:

. / config-- prefix=/usr/local/openssl

Execute the following command to see if the configuration is successful

. / config-t

Execute make and make install at once, compile openssl and install openssl.

# make# make install

Execute the following command to view the dependency package information:

Cd / usr/localldd / usr/local/openssl/bin/openssl

View the installation path

Which openssl

View the version information of openssl:

Openssl version

Finally, you need to configure openssl:

#. / configure-prefix=/usr/local/nginx-with-http_stub_status_module-with-http_gzip_static_module-with-http_ssl_module-with-openssl=/usr/local/openssl

Then test whether ssl is available by executing the following command:

Cd.. / nginx/sbin./nginx-t

If you prompt "nginx.conf syntax is ok" or "nginx.conf test is successful", it means that the ssl module is configured successfully.

This is the end of the content of "how to solve the problem that nginx does not recognize ssl". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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