views:

121

answers:

0

Hey,

I'm trying to do A/B testing and I'm using Nginx fo this purpose. My Nginx config file looks like this:

events {
    worker_connections  1024;
}

error_log /usr/local/experiments/apps/reddit_test/error.log notice;

http {
    rewrite_log  on;

    server {
        listen 8081;
        access_log  /usr/local/experiments/apps/reddit_test/access.log combined;

        location / {
            if ($remote_addr ~ "[02468]$") { 
                rewrite ^(.+)$ /experiment$1 last; 
            }
            rewrite ^(.+)$ /main$1 last;
        }

        location /main {
            internal;
            proxy_pass http://www.reddit.com/r/lisp;
        }

        location /experiment {
            internal;
            proxy_pass http://www.reddit.com/r/haskell;
        }
    }
}

This is kind of working, but css and js files woon't load. Can anyone tell me what's wrong with this config file or what would be the right way to do it?

Thanks,

Alex