Recent Topics

b2evolution 6.10.7 on nginx 1.15.9 and 1.15.11

Started by on Apr 15, 2019 – Contents updated: Oct 04, 2019

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.

Apropos I made a pull request at hoping others will benefit, as well.

server {
  listen 80;
  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, 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.

This post has 1 feedback awaiting moderation...

Form is loading...

Community CMS – This forum is powered by b2evolution CMS, a complete engine for your website.