server { server_name treebird.example.com; location @treebird { include fastcgi.conf; #Check your nginx installation for fastcgi.conf or fastcgi_param fastcgi_param SCRIPT_FILENAME /usr/local/bin/treebird; # change this to the location of your treebird executable fastcgi_param PATH_INFO $uri; fastcgi_pass unix:/var/run/fcgiwrap.socket; } location / { root /usr/local/share/treebird; #Change this to the location of the static files try_files $uri @treebird; } listen [::]:443 ssl; listen 443 ssl; ssl_certificate /etc/letsencrypt/live/treebird.example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/treebird.example.com/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; } server { if ($host = treebird.example.com) { return 301 https://$host$request_uri; } listen 80; listen [::]:80; server_name treebird.example.com; return 404; }