Skip to content

Instantly share code, notes, and snippets.

@keopx
Last active August 29, 2015 14:08
Show Gist options
  • Save keopx/bd4bad025237bbb9664b to your computer and use it in GitHub Desktop.
Save keopx/bd4bad025237bbb9664b to your computer and use it in GitHub Desktop.
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
user = www-data
group = www-data
; The address on which to accept FastCGI requests.
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = /tmp/php5-fpm.sock
;listen = 127.0.0.1:9000
; Set listen(2) backlog.
; Default Value: 128 (-1 on FreeBSD and OpenBSD)
;listen.backlog = 128
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0666
;listen.owner = nobody
;listen.group = nobody
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
#### NEW
#And php!
location ~ \.php$ {
###################################################################
#IMPORTANT SECURITY ISSUE: MUST HAVE cgi.fix_pathinfo = 0 in php.ini
###################################################################
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
### OLD
# location ~ \.php$ {
##########################################################
#IMPORTANT SECURITY ISSUE: cgi.fix_pathinfo = 0 in php.ini
##########################################################
# try_files $uri =404;#No debería ser necesario, pero pa porsi...
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# include fastcgi_params;
# fastcgi_param SCRIPT_FILENAME $request_filename;
# fastcgi_intercept_errors on;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment