Blame public/fs/etc/nginx/vhosts.d/nginx.cgit.conf.in

root@culturestrings 471b9f
server {
root@culturestrings 471b9f
    listen                [::]:80;
root@culturestrings 281232
    server_name           @sitesubd@;
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 281232
    server_name           @sitesubd@;
root@culturestrings 471b9f
    root                  /srv/www/htdocs;
root@culturestrings 471b9f
root@culturestrings 535e17
    # 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 535e17
    # git-http-backend: initial clone GET request
root@culturestrings 535e17
    location ~ ^(/namespace)?/(.+?)/info(/.*)?$ {
root@culturestrings 535e17
        try_files         $uri @git_http_backend;
root@culturestrings 535e17
    }
root@culturestrings 535e17
root@culturestrings 535e17
    # git-http-backend: clone POST request
root@culturestrings 535e17
    location ~ ^(/namespace)?/(.+?)/git-upload-pack {
root@culturestrings 535e17
        try_files         $uri @git_http_backend;
root@culturestrings 535e17
    }
root@culturestrings 535e17
root@culturestrings 535e17
    # otherwise, cgit
root@culturestrings 471b9f
    location / {
root@culturestrings 471b9f
        try_files         $uri @cgit;
root@culturestrings 471b9f
    }
root@culturestrings 471b9f
root@culturestrings 535e17
    location @git_http_backend {
root@culturestrings 535e17
        include           uwsgi_params;
root@culturestrings 535e17
        uwsgi_modifier1   9;
root@culturestrings 535e17
        uwsgi_pass        unix:/run/uwsgi/git.socket;
root@culturestrings 535e17
root@culturestrings 535e17
        uwsgi_param       HTTP_HOST             $server_name;
root@culturestrings 535e17
        uwsgi_param       GIT_PROJECT_ROOT      /srv/git;
root@culturestrings 535e17
        uwsgi_param       PATH_INFO             $uri;
root@culturestrings 535e17
        uwsgi_param       GIT_HTTP_EXPORT_ALL   "";
root@culturestrings 535e17
    }
root@culturestrings 535e17
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 281232
        uwsgi_param       CGIT_CONFIG     /etc/cgit.d/cgitrc.@sitezone@;
root@culturestrings 471b9f
        uwsgi_param       SCRIPT_FILENAME $document_root/cgit.cgi;
root@culturestrings 535e17
        uwsgi_param       PATH_INFO       $uri;
root@culturestrings 535e17
        uwsgi_param       QUERY_STRING    $args;
root@culturestrings 471b9f
    }
root@culturestrings 471b9f
root@culturestrings 281232
    ssl_certificate           /srv/webroot/@sitezone@/ssl/fullchain.pem;
root@culturestrings 281232
    ssl_certificate_key       /srv/webroot/@sitezone@/ssl/privkey.pem;
root@culturestrings 281232
    ssl_trusted_certificate   /srv/webroot/@sitezone@/ssl/chain.pem;
root@culturestrings 471b9f
root@culturestrings 471b9f
    include conf.d/ssl_params;
root@culturestrings 471b9f
}