[Unit]
Description=nginx server
After=postgrest.service gotrue.service adminapi.service
Wants=postgrest.service gotrue.service adminapi.service

[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx -c /etc/nginx/nginx.conf
ExecReload=/usr/local/nginx/sbin/nginx -s reload -c /etc/nginx/nginx.conf
ExecStop=/usr/local/nginx/sbin/nginx -s quit
User=nginx
Slice=services.slice
Restart=always
RestartSec=3
LimitNOFILE=100000

# Via systemd we grant the process a set of privileges to bind to 80/443
# See http://archive.vn/36zJU
AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target
