1

I have a very strange problem: I configure a nginx server with

server {
    listen unix:/home/ingo/repositories/run/gitweb.nginx;
    server_name _;
    access_log /home/ingo/repositories/log/proxy.log main;
    error_log /home/ingo/repositories/log/proxy.log debug;


    # static repo files for cloning over https
    location ~ ^.*\.git/objects/([0-9a-f]+/[0-9a-f]+|pack/pack-[0-9a-f]+.(pack|idx))$ {
            root /home/ingo/repositories;
    }

    # requests that need to go to git-http-backend
    location ~ ^.*\.git/(HEAD|info/refs|objects/info/.*|git-(upload|receive)-pack)$ {
            root /home/ingo/repositories;
            fastcgi_param SCRIPT_FILENAME    /home/ingo/repositories/git-http-backend;
            fastcgi_param PATH_INFO              $uri;
            fastcgi_param GIT_PROJECT_ROOT  /home/ingo/repositories;
            fastcgi_param GIT_HTTP_EXPORT_ALL "";
            fastcgi_pass  unix:/home/ingo/repositories/run/gitweb.sock;
            include fastcgi_params;
    }

    location / {
        root /home/ingo/repositories/;
        gzip off;
        fastcgi_param PATH_INFO $uri;
        fastcgi_param SCRIPT_FILENAME /home/ingo/repositories/gitweb.cgi;
        fastcgi_param GITWEB_CONFIG /home/ingo/repositories/etc/gitweb.conf;
        fastcgi_pass  unix:/home/ingo/repositories/run/gitweb.sock;
        include fastcgi_params;
    }
}   

and use a sub path of my default virtual host (I don't acutally like virtual host names):

    location = /repos { rewrite ^ /repos/ redirect; }
    location /repos/ {
        access_log /home/ingo/repositories/log/proxy.log main;
        error_log /home/ingo/repositories/log/proxy.log debug;
        location /repos/ {
            proxy_pass http://unix:/home/ingo/repositories/run/gitweb.nginx:/;
            sub_filter 'href="' href="/repos/;
            sub_filter_once off;
            proxy_cache off;
        }
        location /repos/static/ {
            alias /usr/share/gitweb/static/;
        }
    }

so that any href=" will be replaces with href="/repos/

That actually works with links and curl. But when I use firefox or chrome I get for example

 <link rel="stylesheet" type="text/css" href="static/gitweb.css"/>

instead of curl -o- 'http://localhost/repos/'|grep css

<link rel="stylesheet" type="text/css" href="/repos/static/gitweb.css"/>

. To circumvent any caching I

  1. opened the debug tab in chrome and enabled "disable cache",
  2. used a firefox-bin instead of the chrome.
  3. removed the cache by hand.
  4. fully restarted chrome.
  5. restarted nginx and fcgiwrap.
  6. added a new repository, that the contents change.

nothing helps!

I always get the wrong URLs in chrome and firefox, but not with links or curl.

0

You must log in to answer this question.

Browse other questions tagged .