From 8bd187bece4f3d03d27ad571c0b21d2ee5e7b044 Mon Sep 17 00:00:00 2001 From: nekobit Date: Wed, 8 Jun 2022 23:18:27 +0000 Subject: [PATCH] Fix nginx config sample FossilOrigin-Name: 7db96f289c477805f18cf4d0d79c3f14bd6f55b80ef4cc37f74c8b30207903a1 --- docs/sample/treebird.nginx.conf | 53 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/docs/sample/treebird.nginx.conf b/docs/sample/treebird.nginx.conf index f2dcbff..58d6ec2 100644 --- a/docs/sample/treebird.nginx.conf +++ b/docs/sample/treebird.nginx.conf @@ -1,38 +1,35 @@ server { + server_name treebird.example.com; - server_name treebird.example.com; + location @treebird { + 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; + include fastcgi.conf; #Check your nginx installation for fastcgi.conf or fastcgi_param + } -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; + 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; - } + if ($host = treebird.example.com) { + return 301 https://$host$request_uri; + } - listen 80; - listen [::]:80; - - server_name treebird.example.com; - return 404; - + listen 80; + listen [::]:80; + server_name treebird.example.com; + return 404; } \ No newline at end of file