nginx-1.18.0
./configure --prefix=$HOME/nginx --with-http_ssl_module
make -j32; make install
[fangjun@localhost ~]$ $HOME/nginx/sbin/nginx -c conf/nginx.conf -p $HOME/nginx
[fangjun@localhost ~]$ $HOME/nginx/sbin/nginx -c conf/nginx.conf -p $HOME/nginx -s stop
作为SSL服务端,必须配置证书.
nginx默认把编译时的prefix
作为errlog, config, ...的目录, 编译时可各自指定errlog, config目录. 可以在nginx.conf中使用指令修改[2].
挪动(要挪挪整个)nginx目录后, 运行时使用-p
指定prefix[1], 文档[2]没有提到.
[1] https://*.com/questions/16865196/nginx-variable-for-path-of-config-file/25486871#25486871
[2] https://nginx.org/en/docs/configure.html