hey

does it support other webserver?

If no, it would be great to support Nginx webserver.
We are using this for drupal as webhosting
https://github.com/omega8cc/nginx-for-drupal
http://drupal.org/project/issues/barracuda
http://drupal.org/project/issues/octopus

Comments

doitDave’s picture

I thought about this as well last week, but there is IMO a simple reason to not treat this as an option for this module: NGINX is not even supported by core, so there is no default "htaccess" you can base on or modify. Also there are few approaches to make Drupal work with nginx anyway.

(However, I would actually appreciate Drupal supporting more than Apache environments officially. But that is beyond my power.)

My honest opinion: Closed, won't fix, but I'll leave it open in kind I'm wrong with that.

Inb4: Same for IIS.

michielnugter’s picture

I see no reason why it shouldn't work on any other server that Drupal also runs on. The only thing is that you need to tell the server how to rewrite the path if you want to use clean urls.

I did a convert of the htaccess lines and came up with the following:

if ($uri ~ "^/js/.*"){
	set $rule_js 1$rule_js;
}
if ($rule_js = "1"){
	rewrite ^/(.*)$ /js.php?q=$1 last;
}

Can you verify this is working with nginx bennos?

michielnugter’s picture

Status: Active » Needs review
bennos’s picture

will test it in a local dev enviroment.

also created a feature request in the barracude queue.
http://drupal.org/node/1876418

omega8cc’s picture

BOA will require an exception for /js.php requests, but in general, the correct method to support it is via location directive, and to avoid searching for other regex based locations and make it faster, it is enclosed in a literal match based, parent location.

###
### Support for http://drupal.org/project/js module.
###
location ^~ /js/ {
  location ~* ^/js/ {
    rewrite ^/(.*)$ /js.php?q=$1 last;
  }
}
michielnugter’s picture

Very cool to see this module supported in barracuda! Thanks for this. I already updated the project page and I'll update the requirments check and configuration page to check for apache.

Is it possible to recognize ngnix server in a _SERVER variable?

omega8cc’s picture

Yes, normally it is possible to detect nginx via standard _SERVER["SERVER_SOFTWARE"] variable, however we have forced it in BOA to use fake ApacheSolaris value, just to satisfy some modules which refuse to work if they don't detect Apache. Not sure if this complicates things?

michielnugter’s picture

Hmm ok, that makes it a bit more difficult.

Can I recognize it any other way? Maybe by a file being present in the root, like an alternative to .htaccess?

omega8cc’s picture

The problem is that there is nothing really Nginx specific to rely on, besides its real _SERVER["SERVER_SOFTWARE"] name, and the .htaccess file is present to avoid false alarms from Boost and others, even if it is never used. Not sure how to make the module aware that it is in fact Nginx behind ApacheSolaris, and not break things for modules assuming there is just one web server in the world :/

bennos’s picture

@michielnugter

You can detect Apache and BOA (via ApacheSolaris). Implemting an autodetection would be the best. For any other webserver or custom nginx setup, just add a Checkbox "Custom" or if the autodetection does not match, and display a short summary what to do or a link to the readme.txt.

michielnugter’s picture

Status: Needs review » Fixed

I added a select box to set the server software. This only makes sure the .htaccess check is only performed when using Apache.

I also revised the installation guide in the readme to reflect the changes.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.