Recent Topics

1 Apr 15, 2019 23:18    

Niltze all-

After much experimentation and frustration at coming up with a base configuration for b2evolution 6.10.7 on Nginx, I came up with the subsequent resource.
I used that as a base for a migration away from my own build of Apache 2.4.29 to my own build of nginx 1.15.9 and subsequently 1.15.11. Along the way, I enhanced the configuration with SSL certificates for a couple of sites, i.e.,

Server Name Indication

A more generic solution for running several HTTPS servers on a single IP address is TLS Server Name Indication extension (SNI, RFC 6066), which allows a browser
to pass a requested server name during the SSL handshake and, therefore, the server will know which certificate it should use for the connection. SNI is currently
supported by most modern browsers, though may not be used by some old or special clients.
https://nginx.org/en/docs/http/configuring_https_servers.html

Apropos I made a pull request at https://github.com/nginxinc/nginx-wiki/pull/440 hoping others will benefit, as well.

server {
  listen 80;
  server_name b2evolution.blog www.b2evolution.blog;
  root /var/www/b2evolution;
  index index.php index.htm index.html;

location / {
    index index.php;
    try_files $uri $uri/ @b2evo;
  }

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        try_files $uri /htsrv/getfile.php?$args;
                expires max;
                log_not_found off;
        }

location @b2evo {
    rewrite ^(.*) /index.php?$1 last;
  }

location /api/ {
auth_basic          off;
rewrite "^/api/v(?<version>[^/]+)/(?<parameters>(.+))$" /htsrv/rest.php?api_version=$version&api_request=$parameters last;
    }

  location ~ \.php$ {
    include /etc/nginx/fastcgi_params;
    fastcgi_pass           unix:/run/php/php7.0-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }

}

P.S. My main interest in building nginx was to integrate the newly released ModSecurity v3 Nginx Connector module. After bragging...er, blogging, about how I built it, I made nginx 1.15.9 available for others to download. And then I realized I had to 'eat my own cooking'.
As I have time I will make nginx 1.15.11 available as well --possibly in a subsequent blog entry.

Big thanks to @DM as I took a couple of directives from his post to complete b2evolution essential functionality.
https://forums.b2evolution.net/nginx-config#c111512

3 Oct 04, 2019 12:53

Niltze all-

Engine X (Nginx) accepted my b2evolution pull request, so now b2evolution recipe is at:
https://www.nginx.com/resources/wiki/start/topics/recipes/b2evolution/

Please note that the configuration file works best when setting up an actual remote b2evo instance, i.e., not locally --as in a virtual machine-- since there are some unresolved hang issues.

Nevertheless, I've been successfully running and upgrading my own Nginx builds, with my own libModSecurity3 and relevant nginx connector, and b2evolution (now 6.11.3) in my own reiser4 custom Google Compute Engine (GCE) virtual machine instances, as well as in remote bare metal hardware (formatted in reiser4, too ;-), since around the start of 2019.

B2evolution on Nginx Rocks!


Form is loading...