nginx配置文件位置(查看nginx配置文件路径和资源文件路径的方法)
类别:服务器 浏览量:809
时间:2022-01-23 02:30:25 nginx配置文件位置
查看nginx配置文件路径和资源文件路径的方法查看nginx配置文件路径
通过 nginx -t
nginx -t命令的原始作用是用来验证nginx配置文件格式和配置是否存在异常,通过该命令会输出nginx的配置文件的路径和验证结果,在输出结果中就可以找到当前的nginx的加载的配置文件的地址,如下所示:
nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
由此可知nginx的配置文件在 /etc/nginx/nginx.conf这个文件夹下
通过 ps -ef|grep nginx
如果在nginx启动的过程中显式的配置了nginx配置文件的加载路径,通过这样的方式就可以很简单的看到当前的配置文件加载路径
通过 locate 命令来进行查找
如果在服务器中有安装locate命令的话,可以通过 locate nginx.conf 这个命令来进行查找,但是如果存在多个nginx.conf 文件的时候,就很难判断到底加载的是哪一个ngxin配置文件
通过 nginx -V 命令来进行查找
通过nginx -V命令可以看到安装时的所有配置信息,通过查找里面的 --conf-path 这个配置信息,可以找到对应的配置文件的路径,如下所示:
nginx -V nginx version: nginx/1.12.2 built by gcc 8.2.1 20180905 (Red Hat 8.2.1-3) (GCC) built with OpenSSL 1.0.2k-fips 26 Jan 2017 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx --add-module=/usr/local/src/headers-more-nginx-module-0.33 --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-http_auth_request_module --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E'
查看nginx资源文件路径
通过 nginx -V 命令
通过nginx -V 命令,然后查找命令中返回的 --prefix= 配置,该配置对应的路径便为nginx的资源文件的路径
到此这篇关于查看nginx配置文件路径和资源文件路径的方法的文章就介绍到这了,更多相关nginx配置文件路径内容请搜索开心学习网以前的文章或继续浏览下面的相关文章希望大家以后多多支持开心学习网!
您可能感兴趣
- nginx宝塔配置修改(宝塔面板默认的404页面不生效怎么办Nginx?)
- nginx配置目录(nginx配置文件使用环境变量的操作方法)
- nginx做转发配置weight啥意思(Nginx中break与last的区别详析)
- nginx状态查询(使用goaccess分析nginx日志的详细方法)
- nginx配置详细讲解(Nginx服务快速入门教程)
- nginx为什么要配置https(Nginx配置Https安全认证的实现)
- linux系统查看nginx系统版本(Linux中Nginx的防盗链和优化的实现代码)
- nginx 反向代理详细配置(nginx反向代理配置去除前缀案例教程)
- nginx proxy设置存放在哪里(nginx配置proxy_pass中url末尾带/与不带/的区别详解)
- nginx是怎样负载均衡的(Nginx四层负载均衡的配置指南)
- nginx 配置https(Nginx下配置Https证书详细过程)
- docker nginx 配置详解(Docker 如何安装 Nginx)
- linux nginx部署前端项目(nginx部署多前端项目的几种方法)
- nginx结构图解(详解Nginx 工作原理)
- nginx怎么配置静态资源(nginx实现发布静态资源的方法)
- nginx学习需要哪些知识(一篇文章搞懂Nginx是什么,能干什么)
- 乔欣 古装剧中的高颜值(古装剧中的高颜值)
- 怎么才可以财富自由(如何让自己实现财富自由)
- 为什么越来越多年轻人回农村(为什么越来越多年轻人回农村生活)
- 怎么快速学好英语(怎么快速学好英语初中)
- 中国留学生都是富二代吗()
- 我们现在吃的苹果是哪里来的 原来现代苹果引入中国仅有一百多年(我们现在吃的苹果是哪里来的)
热门推荐
- javascript将字符串转换成数组(如何将JavaScript将数组转为树形结构)
- pythonsocket详细用法(Python中的Socket 与 ScoketServer 通信及遇到问题解决方法)
- html5canvas案例(h5使用canvas画布实现手势解锁)
- 修改sqlserver数据库所有者
- SQL Server 中@@IDENTITY的用法
- 如何用iis7.5设置网站(IIS .7z文件支持下载的添加方法)
- 如何通过广域网访问ftp服务器(Serv-u 外网访问内网的FTP服务器实现方法)
- 网站测试包括哪些内容
- phpstudy服务器怎么设置(phpstudy2018 访问目录服务权限问题)
- python微信防封(深入学习微信网址链接解封的防封原理visit_type)
排行榜
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9