Next: , Previous: , Up: Services   [Contents][Index]


7.2.7.11 Web Services

The (gnu services web) module provides the following service:

Scheme Procedure: nginx-service [#:nginx nginx] [#:log-directory ``/var/log/nginx''] [#:run-directory ``/var/run/nginx''] [#:vhost-list (list (nginx-vhost-configuration))] [#:config-file]

Return a service that runs nginx, the nginx web server.

The nginx daemon loads its runtime configuration from config-file. Log files are written to log-directory and temporary runtime data files are written to run-directory. For proper operation, these arguments should match what is in config-file to ensure that the directories are created when the service is activated.

As an alternative to using a config-file, vhost-list can be used to specify the list of virtual hosts required on the host. For this to work, use the default value for config-file.

Data Type: nginx-vhost-configuration

Data type representing the configuration of an nginx virtual host. This type has the following parameters:

http-port (default: 80)

Nginx will listen for HTTP connection on this port. Set it at #f if nginx should not listen for HTTP (non secure) connection for this virtual host.

https-port (default: 443)

Nginx will listen for HTTPS connection on this port. Set it at #f if nginx should not listen for HTTPS (secure) connection for this virtual host.

Note that nginx can listen for HTTP and HTTPS connections in the same virtual host.

server-name (default: (list 'default))

A list of server names this vhost represents. 'default represents the default vhost for connections matching no other vhost.

root (default: "/srv/http")

Root of the website nginx will serve.

index (default: (list "index.html"))

Index files to look for when clients ask for a directory. If it cannot be found, Nginx will send the list of files in the directory.

ssl-certificate (default: "/etc/nginx/cert.pem")

Where to find the certificate for secure connections. Set it to #f if you don’t have a certificate or you don’t want to use HTTPS.

ssl-certificate-key (default: "/etc/nginx/key.pem")

Where to find the private key for secure connections. Set it to #f if you don’t have a key or you don’t want to use HTTPS.

server-tokens? (default: #f)

Whether the server should add its configuration to response.


Next: , Previous: , Up: Services   [Contents][Index]