Content-Length: 307689 | pFad | http://github.com/offscale/nginxctl

F9 GitHub - offscale/nginxctl: Commands for modifying and controlling nginx over the command-line
Skip to content

Commands for modifying and controlling nginx over the command-line

License

Apache-2.0 and 2 other licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
CC0-1.0
LICENSE-CC0
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

offscale/nginxctl

nginxctl

License Python version range Python lint & test black Imports: isort

Commands for modifying and controlling nginx over the command-line.

Install dependencies

python -m pip install -r requirements.txt

Install package

python -m pip install .

Usage

usage: python -m nginxctl [-h] [--version] [--listen [LISTEN ...]]
                          [--prefix PREFIX] [--temp_dir TEMP_DIR]
                          [--nginx NGINX] [-b [BLOCK ...]] [-c CONFIG]
                          [-{ [OPEN_PAREN ...]] [-} [CLOSE_PAREN ...]]
                          {dry_run,emit,nginx,serve,upsert}

Commands for modifying and controlling nginx over the command-line.

positional arguments:
  {dry_run,emit,nginx,serve,upsert}
                        serve, emit, nginx, or dry_run

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --listen [LISTEN ...]
                        Listen (e.g., port)
  --prefix PREFIX       set prefix path, e.g., '/opt/homebrew/etc/nginx'
  --temp_dir TEMP_DIR   serve uses this directory
  --nginx NGINX         Path to nginx binary, defaults to first in PATH, i.e.,
                        '/opt/homebrew/bin/nginx'
  -b [BLOCK ...], --block [BLOCK ...]
                        Block, e.g., server or http
  -c CONFIG, --config CONFIG
                        Name of file. Placed in prefix folder—e.g.,
                        '/opt/homebrew/bin/nginx'—if not absolute. E.g.,
                        nginx.conf
  -{ [OPEN_PAREN ...]   Starting parentheses (raise hierarchy). Note:
                        `-b`/`--block` does this also.
  -} [CLOSE_PAREN ...]  Ending parentheses (lower hierarchy)

Example usage: python -m nginxctl -w '/tmp/wwwroot' -p 8080 -i '192.168.2.1'
-w '/mnt/webroot' -p 9001 -i 'localhost' --path '/api' --proxy-pass
'192.168.2.1/api'

Examples

Serve local directory and then stop server

$ python -m nginxctl serve --temp_dir '/tmp' \ 
            -b 'server' \
              --server_name 'localhost' --listen '8080' \
              -b location '/' \
                --root '/tmp/wwwroot' \
              -'}' \
            -'}'
nginx is running. Stop with: /usr/local/bin/nginx -c /tmp/nginx.conf -s stop
$ curl -Is http://localhost:8080 | head -n1
127.0.0.1 - - [03/Apr/2020:01:21:45 +1100] "HEAD / HTTP/1.1" 200 0 "-" "curl/7.64.1"
HTTP/1.1 200 OK
$ python -m nginxctl nginx --temp_dir '/tmp' -s stop

License

Licensed under any of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

About

Commands for modifying and controlling nginx over the command-line

Resources

License

Apache-2.0 and 2 other licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
CC0-1.0
LICENSE-CC0
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/offscale/nginxctl

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy