|
root@culturestrings |
471b9f |
server {
|
|
root@culturestrings |
471b9f |
listen [::]:80;
|
|
root@culturestrings |
471b9f |
server_name git.midipix.org;
|
|
root@culturestrings |
471b9f |
return 301 https://$server_name$request_uri;
|
|
root@culturestrings |
471b9f |
}
|
|
root@culturestrings |
471b9f |
|
|
root@culturestrings |
471b9f |
server {
|
|
root@culturestrings |
471b9f |
listen [::]:443;
|
|
root@culturestrings |
471b9f |
server_name git.midipix.org;
|
|
root@culturestrings |
471b9f |
root /srv/www/htdocs;
|
|
root@culturestrings |
471b9f |
|
|
root@culturestrings |
b70bac |
# legacy (bookmarked) /cgit.git addresses
|
|
root@culturestrings |
471b9f |
location /cgit.cgi {
|
|
root@culturestrings |
471b9f |
rewrite ^/cgit.cgi(/.*)$ $1 last;
|
|
root@culturestrings |
471b9f |
}
|
|
root@culturestrings |
471b9f |
|
|
root@culturestrings |
b70bac |
# git-http-backend: initial clone GET request
|
|
root@culturestrings |
b70bac |
location ~ ^(/namespace)?/(.+?)/info(/.*)?$ {
|
|
root@culturestrings |
b70bac |
try_files $uri @git_http_backend;
|
|
root@culturestrings |
b70bac |
}
|
|
root@culturestrings |
b70bac |
|
|
root@culturestrings |
b70bac |
# git-http-backend: clone POST request
|
|
root@culturestrings |
b70bac |
location ~ ^(/namespace)?/(.+?)/git-upload-pack {
|
|
root@culturestrings |
b70bac |
try_files $uri @git_http_backend;
|
|
root@culturestrings |
b70bac |
}
|
|
root@culturestrings |
b70bac |
|
|
root@culturestrings |
b70bac |
# otherwise, cgit
|
|
root@culturestrings |
471b9f |
location / {
|
|
root@culturestrings |
471b9f |
try_files $uri @cgit;
|
|
root@culturestrings |
471b9f |
}
|
|
root@culturestrings |
471b9f |
|
|
root@culturestrings |
b70bac |
location @git_http_backend {
|
|
root@culturestrings |
b70bac |
include uwsgi_params;
|
|
root@culturestrings |
b70bac |
uwsgi_modifier1 9;
|
|
root@culturestrings |
b70bac |
uwsgi_pass unix:/run/uwsgi/git.socket;
|
|
root@culturestrings |
b70bac |
|
|
root@culturestrings |
b70bac |
uwsgi_param HTTP_HOST $server_name;
|
|
root@culturestrings |
b70bac |
uwsgi_param GIT_PROJECT_ROOT /srv/git;
|
|
root@culturestrings |
b70bac |
uwsgi_param PATH_INFO $uri;
|
|
root@culturestrings |
b70bac |
uwsgi_param GIT_HTTP_EXPORT_ALL "";
|
|
root@culturestrings |
b70bac |
}
|
|
root@culturestrings |
b70bac |
|
|
root@culturestrings |
471b9f |
location @cgit {
|
|
root@culturestrings |
471b9f |
include uwsgi_params;
|
|
root@culturestrings |
471b9f |
uwsgi_modifier1 9;
|
|
root@culturestrings |
471b9f |
uwsgi_pass unix:/run/uwsgi/cgit.socket;
|
|
root@culturestrings |
471b9f |
|
|
root@culturestrings |
471b9f |
uwsgi_param HTTP_HOST $server_name;
|
|
root@culturestrings |
e8d6b1 |
uwsgi_param CGIT_CONFIG /etc/cgit.d/cgitrc.midipix.org;
|
|
root@culturestrings |
471b9f |
uwsgi_param SCRIPT_FILENAME $document_root/cgit.cgi;
|
|
root@culturestrings |
e8d6b1 |
uwsgi_param PATH_INFO $uri;
|
|
root@culturestrings |
e8d6b1 |
uwsgi_param QUERY_STRING $args;
|
|
root@culturestrings |
471b9f |
}
|
|
root@culturestrings |
471b9f |
|
|
root@culturestrings |
41c9d2 |
ssl_certificate /home/webroot/midipix.org/ssl/fullchain.pem;
|
|
root@culturestrings |
41c9d2 |
ssl_certificate_key /home/webroot/midipix.org/ssl/privkey.pem;
|
|
root@culturestrings |
41c9d2 |
ssl_trusted_certificate /home/webroot/midipix.org/ssl/chain.pem;
|
|
root@culturestrings |
471b9f |
|
|
root@culturestrings |
471b9f |
include conf.d/ssl_params;
|
|
root@culturestrings |
471b9f |
}
|