Skip to content

Instantly share code, notes, and snippets.

@ebta
Last active September 28, 2023 14:36
Show Gist options
  • Save ebta/5c83cdf26224bd5457531fce17c817af to your computer and use it in GitHub Desktop.
Save ebta/5c83cdf26224bd5457531fce17c817af to your computer and use it in GitHub Desktop.
Run Fossil Server in Linux using NGINX as SCGI
# Jalankan service fossil dengan syntax berikut (sesuaikan port)
# /usr/local/bin/fossil server --port 12345 --scgi /dir/location/data/repo
# Atau dibuat service agar bisa otomatis startup melalui script berikut :
# https://gist.github.com/ebta/1c30036d477289d7d33f847497566390
server {
server_name therepo.domain.com;
root /usr/local/bin/fossil;
location / {
scgi_param REQUEST_METHOD $request_method;
scgi_param REQUEST_URI $request_uri;
scgi_param QUERY_STRING $query_string;
scgi_param CONTENT_TYPE $content_type;
scgi_param DOCUMENT_URI $document_uri;
scgi_param DOCUMENT_ROOT $document_root;
scgi_param SCGI 1;
scgi_param SERVER_PROTOCOL $server_protocol;
scgi_param REQUEST_SCHEME $scheme;
scgi_param HTTPS $https if_not_empty;
scgi_param REMOTE_ADDR $remote_addr;
scgi_param REMOTE_PORT $remote_port;
scgi_param SERVER_PORT $server_port;
scgi_param SERVER_NAME $server_name;
scgi_param SCRIPT_NAME "";
scgi_param HTTPS "on";
scgi_pass localhost:12345;
}
listen [::]:443 ssl http2;
listen 443 ssl http2;
ssl_certificate /etc/letsencrypt/live/therepo.domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/therepo.domain.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
server {
if ($host = therepo.domain.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name therepo.domain.com;
return 404; # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment