1
0

git.sr.ht.conf 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. server {
  2. include sourcehut.conf;
  3. include port80.conf;
  4. server_name git.localtest.me;
  5. client_max_body_size 100M;
  6. location / {
  7. proxy_pass http://srhts:5001;
  8. include headers.conf;
  9. add_header Content-Security-Policy "default-src 'none'; style-src 'self' 'unsafe-inline'; img-src * data:; script-src 'self' 'unsafe-inline'" always;
  10. include web.conf;
  11. }
  12. location /query {
  13. proxy_pass http://srhts:5101;
  14. include graphql.conf;
  15. }
  16. location /static {
  17. root /usr/lib/$python/site-packages/gitsrht;
  18. expires 30d;
  19. }
  20. location = /authorize {
  21. proxy_pass http://srhts:5001;
  22. proxy_pass_request_body off;
  23. proxy_set_header Content-Length "";
  24. proxy_set_header X-Original-URI $request_uri;
  25. }
  26. location ~ ^/([^/]+)/([^/]+)/(HEAD|info/refs|objects/info/.*|git-upload-pack).*$ {
  27. auth_request /authorize;
  28. root /var/lib/git;
  29. fastcgi_pass unix:/run/fcgiwrap/fcgiwrap.sock;
  30. fastcgi_param SCRIPT_FILENAME /usr/libexec/git-core/git-http-backend;
  31. fastcgi_param PATH_INFO $uri;
  32. fastcgi_param GIT_PROJECT_ROOT $document_root;
  33. fastcgi_read_timeout 500s;
  34. include fastcgi_params;
  35. gzip off;
  36. }
  37. }