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 configure after installing nginx under linux

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains "how to configure after installing nginx under linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to configure after installing nginx under linux"!

1. Nginx installation

Nginx had better download the nginx package and related command resources directly on linux, otherwise there will be no sbin folder, the specific installation steps can be your own Baidu ha

II. Configuration of nginx

Go to the conf folder, modify the nginx.conf file, and modify the mapped domain name and port. Nginx defaults to mapping port 80, but it can also be changed to something else. If you need to configure multiple domain names, just copy a server and then configure it.

Note: when server_name specifies a domain name, you cannot add http://, to the domain name, otherwise the following error will be reported. Proxy_pass can add http.

III. Start-up of nginx

Save the modified nginx.conf file, go to the sbin folder, and start nginx:

/ usr/local/nginx/sbin/nginx-c / usr/local/nginx/conf/nginx.conf

Start successfully without error message. You can check the nginx process.

If the error port is occupied, such as port 80, you need to close port 80 first, and then restart it (if other online systems already occupy port 80, you can change the listening port to another port to test whether the nginx starts successfully, and then close port 80 when the online system is idle, change the system port, add a mapping to the nginx configuration file, and then restart)

At this point, I believe you have a deeper understanding of "how to configure after installing nginx under linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Internet Technology

Wechat

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

12
Report