Last active
February 10, 2021 19:38
-
-
Save cite/6419890 to your computer and use it in GitHub Desktop.
nginx/php-fpm configuration for Gallery3.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[gallery3] | |
user = vhost-user | |
group = vhost-group | |
listen = /tmp/gallery3-example-com.sock | |
listen.group = www-data | |
listen.mode = 0660 | |
pm = dynamic | |
pm.max_children = 5 | |
pm.min_spare_servers = 1 | |
pm.max_spare_servers = 3 | |
pm.max_requests = 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gallery3.example.com definition | |
server { | |
server_name gallery3.example.com; | |
listen 80; | |
listen [::]:80; | |
root /srv/www/http-gallery3-example-com; | |
access_log /var/log/nginx/access-gallery3.example.com.log; | |
index index.php; | |
location / { | |
location ~ /(index\.php/)?(.+)$ { | |
try_files $uri /index.php?kohana_uri=$2&$args; | |
location ~ /\.(ht|tpl(\.php?)|sql|inc\.php|db)$ { | |
deny all; | |
} | |
location ~ /var/(uploads|tmp|logs) { | |
deny all; | |
} | |
location ~ /bin { | |
deny all; | |
} | |
location ~ /var/(albums|thumbs|resizes) { | |
rewrite ^/var/(albums|thumbs|resizes)/(.*)$ /file_proxy/$2 last; | |
} | |
location ~* \.(js|css|png|jpg|jpeg|gif|ico|ttf)$ { | |
try_files $uri /index.php?kohana_uri=$uri&$args; | |
expires 30d; | |
} | |
} | |
location = /index.php { | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/tmp/gallery3-example-com.sock; | |
fastcgi_index index.php; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
include fastcgi_params; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After years (literally!) of nightmares, I finally found out what was wrong with my configuration...
You have to change this on
config.php
:... or else, Gallery3 will not work under
nginx
. Duh! So simple...Here's the reference (which also cites this very same gist): http://jonamiller.com/2015/02/15/gallery3-on-nginx/
Kudos to @jonmiller for having found a working solution. Gallery3 is now purring like a kitty under PHP 7.4, and soon (hopefully) under 8.0 as well!