Recently moved my geeklog (+6,000 posts, +10,000 forum posts, +2500 users, 60 MB database, almost 20 years of data) to a new URL at https://blog.alcancelibre.org . New server uses Nginx+PHP-FPM. So, here you have the full Nginx/PHP-FPM configuration needed for Geeklog 2.2.*.
Text Formatted Code
server {
listen 80;
# Let certbot deal with the https support.
server_name www.yourdomain.net;
root /home/username/public_html;
access_log /var/log/nginx/yourdomain-access_log main;
error_log /var/log/nginx/yourdomain-error_log notice;
charset UTF-8;
# The value of client_max_body_size has to be the same as the values
# of PHP upload_max_filesize and post_max_size
client_max_body_size 128M;
client_body_buffer_size 128M;
server_tokens off;
# This file has the options for gzip compression.
# See: https://ubiq.co/tech-blog/how-to-enable-nginx-gzip-compression/
include /etc/nginx/default.d/gzip.conf;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
# Make sure your all the external components form third-party CDNS of your
# layout theme are listed here. Otherwise your website will not display!
# Enable and test. Disable again if you do not know how to get all the external CDNs.
# add_header Content-Security-Policy: "default-src 'self' https://code.jquery.com https://cdnjs.cloudflare.com https://analytics.google.com";
location / {
index index.html index.htm index.php;
error_page 404 /404.php;
rewrite "^/article.php/(.*)$" /article.php?story=$1 last;
rewrite "^/staticpages/index.php/(.*)$" /staticpages/index.php?page=$1 last;
rewrite "^/links/portal.php/link/(.*)$" /links/portal.php?what=link&item=$1 last;
rewrite "^/directory.php/(.*)/(\d{1,})/(\d{1,})$" /directory.php?topic=$1&year=$2&month=$3 last;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
log_not_found off;
access_log off;
}
location ~/\.(ht|git) {
deny all;
}
location /.well-known {
default_type "text/plain";
}
location ~ ^/install/(.+\.php)$ {
allow 127.0.0.1;
# Put your IP address here
allow 192.168.100.6;
deny all;
#allow all;
}
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_intercept_errors on;
include fastcgi_params;
fastcgi_param SERVER_NAME $host;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:8500;
# The values for upload_max_filesize and post_max_size MUST be the
# same as nginx client_max_body_size
fastcgi_param PHP_VALUE "upload_max_filesize=128M \n post_max_size=128M";
fastcgi_index index.php;
# Installation or upgrades may fail if these ones have lower values
fastcgi_read_timeout 600;
proxy_buffers 16 16k;
proxy_buffer_size 16k;
proxy_connect_timeout 3600s;
proxy_read_timeout 3600;
proxy_send_timeout 3600;
}
}
Text Formatted Code
[geeklog]
user = username
group = username
listen = localhost:8500
pm = dynamic
pm.max_children = 9999
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 5
php_admin_value[upload_tmp_dir] = /home/username/tmp
php_admin_value[session.save_path] = /home/username/tmp
php_admin_flag[log_errors] = on
php_admin_value[error_log] = /home/username/logs/php-fpm-error_log
php_value[error_reporting] = E_ALL|E_NOTICE
php_value[max_execution_time] = 7200
; You will need at least 512M to install or upgrade
php_value[memory_limit] = 1024M
; Set your own time zone
php_value[date.timezone] = America/Mexico_City
php_value[expose_php] = off
; Installation or upgrades may fail if these ones have lower values
php_value[request_terminate_timeout] = 600
php_value[max_input_time] = 360
php_value[max_input_vars] = 4000