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:


I think the main problem is the RewriteBase...

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


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

    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.


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.


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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.