Skip to content

Latest commit

 

History

History
30 lines (17 loc) · 1.07 KB

nginx.rst

File metadata and controls

30 lines (17 loc) · 1.07 KB

Nginx Functions

Tasks for configuring sites running under the Nginx webserver.

remove_default_site()

Nginx installs with a default server listening on 80 defined in /etc/nginx/sites-enabled/default.conf. This task removes that configuration.

upload_nginx_site_conf(site_name, template_name=None, context=None, enable=True)

This task uploads a new configuration to /etc/nginx/sites-available/<site_name>. This looks for a template named nginx/<site_name>.conf and if not found uploads the default nginx/site.conf unless template_name is given. By default this site configuration will be enabled /etc/nginx/sites-enabled/.

enable_site(site_name)

Enables a site in /etc/nginx/sites-available/<site_name> and links it to /etc/nginx/sites-enabled/<site_name>.

disable_site(site_name)

Disables a site in /etc/nginx/sites-enabled/ by the name. The configuration in /etc/nginx/sites-available/ is not touched.