#!/usr/bin/env bash cat << EOF > /etc/nginx/sites-enabled/default server { listen $CGIT_PORT; server_name $CGIT_HOSTNAME; server_tokens off; root /usr/share/cgit; # Serve static files with nginx location ~* ^.+(cgit.(css|png)|favicon.ico|robots.txt) { root /usr/share/cgit; expires 30d; } location / { try_files \$uri @cgit; } location @cgit { gzip off; include uwsgi_params; uwsgi_modifier1 9; uwsgi_pass unix:/run/uwsgi/cgit.sock; } } EOF uwsgi --daemonize --ini /etc/uwsgi/cgit.ini > /dev/stdout 2> /dev/stderr < /dev/null & nginx -c /etc/nginx/nginx.conf -g "daemon off;"