Skip to content

unix socket instead of tcp sockets between nginx and php-fpm #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/fpm-pool.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ error_log = /dev/stderr
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = 127.0.0.1:9000
listen = /run/php-fpm.sock

; Enable status page
pm.status_path = /fpm-status
Expand Down
6 changes: 3 additions & 3 deletions config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ http {
root /var/lib/nginx/html;
}

# Pass the PHP scripts to PHP-FPM listening on 127.0.0.1:9000
# Pass the PHP scripts to PHP-FPM listening on php-fpm.sock
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/run/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
Expand All @@ -79,7 +79,7 @@ http {
deny all;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/run/php-fpm.sock;
}
}

Expand Down