Home > Operation and Maintenance > Nginx > How to configure file path in nginx

How to configure file path in nginx

藏色散人
Release: 2019-06-12 10:18:59
Original
15883 people have browsed it

How to configure file path in nginx

After the Nginx installation is completed, the default installation location of yum is /etc/nginx middle. The configuration file is located at: /etc/nginx/nginx.conf. You can modify the number of processors, log path, pid file path, etc., and the default log.

错误日志    /var/log/nginx/error.log 
 访问日志    /var/log/nginx/access.log
Copy after login

How to configure file path in nginx

The include /etc/nginx/conf.d/.conf at the end of nginx.conf means to include the user Put your own configuration in conf.d/*

Modify the default server configuration, including the listening port listen and file directory root

$ vi /etc/nginx/conf.d/default.conf
Copy after login

How to configure file path in nginx

Change Nginx’s default Change the access path to /data/www/html, change the listening port listen to 8888 (or 80, whichever you want), start Nginx,

$ /etc/init.d/nginx start
Copy after login

After modifying the nginx configuration, you can restart it without affecting use. Start Nginx,

$ /etc/init.d/nginx reload
Copy after login

For more Nginx related knowledge, please visit the Nginx Usage Tutorial column!

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

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template