WackoWiki: Nginx settings example for WackoWiki R5.4

https://wackowiki.org/doc     Version: 3 (19.02.2022 13:43)

Nginx settings example for WackoWiki R5.4

nginx.conf
worker_processes  3;

error_log   /var/log/nginx/error.log;

events {
    worker_connections  1024;
}

http {
    proxy_temp_path /var/spool/nginx/tmp/proxy;
    fastcgi_temp_path /var/spool/nginx/tmp/fastcgi;
    client_body_temp_path /var/spool/nginx/tmp/client;

    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    sendfile  on;

    # connects to backend
    connection_pool_size 64;

    gzip  on;
    gzip_types	text/plain;

	server {
		listen  10.10.0.1:80;
		server_name .*;
		root /var/www/html/addon-modules/wackowiki.nginx;

		location / {
			index index.php;
			if (-d $request_filename) {
				rewrite ^(.*/[^\./]*[^/])$ $1/;
				break;
			}
			if ($request_uri ~* "^/(files|images|js|themes|xml)/") {
				break;
			}
			rewrite "^(.*)$" "index.php?page=$1" last;
		}

		location ~* ^/(_cache|actions|classes|db|formatters|handlers|lang|libs|setup) {
			deny all;
		}

		location ~* \.php?.*$
		{
			fastcgi_pass localhost:1066;
			fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
			fastcgi_param REQUEST_URI $request_uri;
			fastcgi_param QUERY_STRING $query_string;
			fastcgi_param REQUEST_METHOD $request_method;
			fastcgi_param CONTENT_TYPE $content_type;
			fastcgi_param CONTENT_LENGTH $content_length;
			fastcgi_param DOCUMENT_ROOT $document_root;
			fastcgi_param SERVER_NAME $server_name;
			fastcgi_param HTTP_COOKIE $http_cookie;
			#fastcgi_param PATH_INFO $query_string;
			fastcgi_intercept_errors off;
			fastcgi_index index.php;
		}

		charset cp1251;
		access_log /var/log/nginx/access.log;
	}
}