导航

Nginx 编译安装配置

6个月前 · 620人浏览

Configure

./configure --prefix=/nginx/ --user=www-data --group=www-data --with-compat --with-debug --with-file-aio --with-threads --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_sub_module --with-http_gunzip_module --with-http_auth_request_module --with-http_secure_link_module --with-http_gzip_static_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-stream=dynamic --with-stream_ssl_module --with-http_realip_module --with-pcre --with-pcre-jit --with-stream_ssl_preread_module --with-http_degradation_module --with-http_random_index_module

 

自启动服务

服务文件位置

/lib/systemd/system/nginx.service

 

内容

[Unit]
Description=Nginx Service
After=network.target

[Service]
Type=forking
ExecStart=/nginx/sbin/nginx
ExecReload=/nginx/sbin/nginx -s reload
ExecStop=/nginx/sbin/nginx -s quit
PrivateTmp=true

[Install]
WantedBy=multi-user.target

 

配置文件位置

/nginx/conf/nginx.conf

 

评论
更换验证码
2025 Teris 的秘密基地 All Rights Reserved.