How to convert my nginx configuration to haproxy?

Viewed 251

I'm installing a Source Hut instance but my reverse proxy is Haproxy and the config example is for nginx. I have sucessfully translated the "meta.sr.ht" nginx config to haproxy but I can't understand how this one function and how I can translate it to Haproxy.

location = /authorize {
    proxy_pass http://127.0.0.1:5001;
    proxy_pass_request_body off;
    proxy_set_header Content-Length "";
    proxy_set_header X-Original-URI $request_uri;
}

location ~ ^/([^/]+)/([^/]+)/(HEAD|info/refs|objects/info/.*|git-upload-pack).*$ {
    auth_request /authorize;
    root /var/lib/git;
    fastcgi_pass unix:/run/fcgiwrap.sock;
    fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
    fastcgi_param PATH_INFO $uri;
    fastcgi_param GIT_PROJECT_ROOT $document_root;
    fastcgi_param GIT_HTTP_EXPORT_ALL "";
    include fastcgi_params;
    gzip off;
}

The manual page related to that

FIX : Fixed by not using SourceHut. Sad but it works.

0 Answers
Related