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

How to configure file path in nginx

藏色散人
藏色散人 Original
2019-06-12 10:18:38 15746browse

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

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

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

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

$ /etc/init.d/nginx reload

For more Nginx related knowledge, please visit theNginx Usage Tutorialcolumn!

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!

Statement:
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