0

I'm trying to install thebuggenie on my Nginx server. Unfortunately, it sits in a subdirectory (nothing I can do about it) and uses apache rewrites for ALL of it's URLs. I had some success when I had moved everything from the subdirectory, but unfortunately there are things in the main (root) directory that it needs. Anyway, I have the .htaccess file that it provides and I need to know how to convert the rewrites to nginx rewrites. My config files are here:

http://paste-bin.com/view/eb48c716

I think the main problem is the RewriteBase...

Sorry about joining them together, I am currently unable to add more than 1 URL.

3 Answers 3

2

I know this question is old, but found a solution for thebuggenie 3.1.4 running with nginx 1.0.6:

server {
    server_name site.com;
    root /var/www/site/public_html/thebuggenie;
    large_client_header_buffers 4 8k;
    index index.php index.html;

    location ~ \..*/.*\.php$ { return 403; }

    location ~ \.php {
      #add fastcgi_param values to suit environment
      fastcgi_pass 127.0.0.1:9000;
  }

    location ~ /(?<suburi>.*){
      set $suburi $1;
      try_files $uri $uri/ /index.php?url=$suburi&$args;
  }

}

Some notes

  1. root setting - while you may extract & install in /var/www/site/public_html/ , the program expects the site root to be in the "thebuggenie" directory.

  2. The default location block location ~ /(?... needs to follow the php fastcgi block.

If anyone has any further enhancements / more optimal approaches, I'd love to see them.

1

To complete jimg's answer, if your document root points to the thebuggenie installation dir (so you can simply point to http://<your-server>/), the appropriate regex to use for nginx is:

location ~ /(.*) {
    try_files $uri $uri/ /index.php?url=$1&$args;
}

You can still use set $suburi $1; if you like, but even in jimg's example you can simply use $1 directly.

0

Sounds like the software was designed with a heavy dependence to apache. I would use nginx in front of apache for this site. Put apache on 8080 localhost or something similar. You still get the benefits of nginx for static files without having to rewrite all their rules. Otherwise I would bitch to thebuggenie and get them to translate their apache rewrites for you. That's Lame.

1
  • thanks, I was trying to avoid apache, but it looks like that won't be possible :(
    – user61832
    Nov 29, 2010 at 8:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .