nginx - Is there a CLI tool for editing the configuration file?
Asked Answered
N

2

9

For example, I'd like to set a new or remove a virtual host in the nginx.conf configuration file without editing it directly but using a command-line tool, like:

nginx-cli add-server [options]
nginx-cli remove-server [options]
Nocti answered 30/10, 2011 at 23:14 Comment(0)
T
1

I don't know if either of these will exactly fill your need, but they both offer some tools for nginx

  • Nginx VHost Tools includes a tool for generating and saving a nginx config file, which might help.
  • Nginx Tools has a tool for managing sites as well as minifying config files. Probably not what you're looking for, but you may the source helpful.
Transitive answered 30/10, 2011 at 23:35 Comment(0)
Z
0

You can use nano to open an editor for your file.

A basic example would be (unless you are running as root, you'll have to prefix the command with sudo):

nano nginx.conf
Zemstvo answered 19/5 at 10:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.