Raj*_* .E 4 configuration nginx openam
我已经在 ubuntu16.04 中安装了 nginx,并检查配置文件位置是/etc/nginx/conf/nginx.conf
$ /usr/sbin/nginx -V 2>&1 | grep --colour=auto conf
Run Code Online (Sandbox Code Playgroud)
然后显示配置文件路径:
--conf-path=/etc/nginx/nginx.conf
Run Code Online (Sandbox Code Playgroud)
我正在安装openam nginx Webagent 链接,这个nginx_agent有一个nginx.conf文件
nginx_web_agent 安装路径:
/opt/nginx_agent
Run Code Online (Sandbox Code Playgroud)
nginx_web_agent nginx.conf 路径:
/opt/nginx_agent/conf/nginx.conf
Run Code Online (Sandbox Code Playgroud)
nginx_web_agent 使用那个nginx.conf文件,
如何将 nginx默认 nginx.conf文件更改为nginx_web_agent nginx.conf文件
例如:
nginx 配置使用/opt/nginx_agent/conf/nginx.conf而不是/etc/nginx/nginx.conf
建议我我该怎么做?
kri*_*sFR 10
/usr/sbin/nginx -V
显示初始配置脚本参数,不一定是正在运行的实际参数。
要使用替代配置文件,而不是默认配置文件,您可以设置-c
标志(man nginx):
/usr/sbin/nginx -c /opt/nginx_agent/conf/nginx.conf
Run Code Online (Sandbox Code Playgroud)
Ubuntu 16.04 用于systemd
管理服务,因此您需要更改service 的systemd
参数nginx
:
/lib/systemd/system/nginx.service
-c
在需要的地方添加标志:
ExecStartPre=/usr/sbin/nginx -t -c /opt/nginx_agent/conf/nginx.conf -q -g 'daemon on; master_process on;'
ExecStart=/usr/sbin/nginx -c /opt/nginx_agent/conf/nginx.conf -g 'daemon on; master_process on;'
ExecReload=/usr/sbin/nginx -c /opt/nginx_agent/conf/nginx.conf -g 'daemon on; master_process on;' -s reload
Run Code Online (Sandbox Code Playgroud)重新加载systemd
管理器配置:
systemctl daemon-reload
启动nginx
服务:
service nginx start
Run Code Online (Sandbox Code Playgroud)检查nginx
服务参数:
systemctl status nginx.service
...
2411 nginx: master process /usr/sbin/nginx -c /opt/nginx_agent/conf/nginx.conf -g daemon on; master_process on
...
Run Code Online (Sandbox Code Playgroud)这是我会做的方式。
归档时间: |
|
查看次数: |
15931 次 |
最近记录: |