本文关键详细介绍了查询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 0905 (Red Hat 8.2.1-3) (GCC)
built with OpenSSL 1.0.2m-fips 26 Jan
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配置文件路径內容请搜索大家之前的文章内容或再次访问 下边的相关文章期待大伙儿之后多多的适用大家!
热搜词