当前位置:首页 > nginx > 正文

nginx运行命令(nginx常用windows命令)

  • nginx
  • 2024-04-03 21:45:11
  • 3067
nginx 运行命令

nginx 的运行命令如下:


nginx [-c ] [-g ]
要素:

  • -c <config file>:指定 nginx 配置文件。 默认情况下,nginx 寻找 /etc/nginx/nginx.conf。


  • -g <directives>:在启动时传递给 nginx 的配置指令。


  • 示例:

    • 使用默认配置文件启动 nginx:


      nginx



    • 使用自定义配置文件启动 nginx:


      nginx -c /path/to/my_config.conf



    • 在启动时配置 nginx 打开日志文件:


      nginx -g "error_log /var/log/nginx/error.log;"