treebird-docker/treebird.nginx

61 lines
2.3 KiB
Nginx Configuration File

server {
server_name treebird.example.com;
location @treebird {
# These are added manually because the FCGI include varies radically
# between installs in some cases I have seen...
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param SCRIPT_FILENAME /usr/local/bin/treebird;
fastcgi_param PATH_INFO $uri;
fastcgi_pass 127.0.0.1:4008; # Port can be changed if set to match container port
}
location / {
root /var/www/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;
# Set the default upload limit (only 1M if not set!)
client_max_body_size 50M;
}
server {
if ($host = treebird.example.com) {
return 301 https://$host$request_uri;
}
listen 80;
listen [::]:80;
server_name treebird.example.com;
return 404;
}