I created a vhost file at
/var/aegir/config/server_master/nginx/vhost.d

that looks like this:

server {
   include     /var/aegir/config/includes/fastcgi_params.conf;
   limit_conn  gulag 10;
   listen      *:80;
   server_name subdomain.mydomain.com;
   root        /var/www/subdomain;
   index       index.php index.html;
   include     /var/aegir/config/includes/nginx_compact_include.conf;
}

However, pointing the browser to http://subdomain.mydomain.com does not open the static index.html file there.
http://subdomain.mydomain.com/index.html works fine.

Comments

omega8cc’s picture

Example for WordPress site:
https://gist.github.com/1677835
Create it as: /var/aegir/config/includes/nginx_wp_include.conf
and use this path in your custom vhost.

Example for static site, with some PHP files:
https://gist.github.com/1677848
Create it as: /var/aegir/config/includes/nginx_static_include.conf
and use this path in your custom vhost, but change the order:

index index.html index.php;

omega8cc’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

dschargel’s picture

Thanks for those two great gist examples, but y'all should be sure to change the fastcgi_pass php-fpm listening port from 9000 to 9090.

realityloop’s picture

Version: » 6.x-2.x-dev
macmladen’s picture

@omega8cc not sure if this is the right place to ask but it is along the lines..

I used your conf files and they work, but the static one from https://gist.github.com/1677848 works only on index.html an compact include works only on index.php (of course they both work if explicitly called).

I'm still learning nginx (being good with apache) so I'm not sure which part is unable to detect both index.php and index.html as configured in conf file.

What I would like to have is something like compact that serves first index.html and then index.php if html was not present (from what I've seen, static and compact are similar, only rewrite differs).

Here is vhost.d/my.conf:

server {
   include     /var/aegir/config/includes/fastcgi_params.conf;
   limit_conn   limreq 32; # like mod_evasive - this allows max 32 simultaneous connections from one IP address
   listen      *:80;
   server_name mydomain.biz;
   root        /data/disk/o1/non-aegir/mydomain.biz;
   index       index.html index.php;
   include     /var/aegir/config/includes/nginx_compact_include.conf;
}
omega8cc’s picture

@MacMladen It is something beyond the BOA project scope, so the correct place to discuss this is the group at https://groups.drupal.org/boa