mirror of
https://github.com/jkaninda/nginx-php-fpm.git
synced 2025-12-07 14:09:42 +01:00
first commit
This commit is contained in:
42
src/conf/nginx/default.conf
Normal file
42
src/conf/nginx/default.conf
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
server_name _;
|
||||
# Add index.php to setup Nginx, PHP & PHP-FPM config
|
||||
index index.php index.html index.htm index.nginx-debian.html; error_log /var/log/nginx/error.log;
|
||||
access_log /var/log/nginx/access.log;
|
||||
root /var/www/html/public;
|
||||
# pass PHP scripts on Nginx to FastCGI (PHP-FPM) server
|
||||
location ~ \.php$ {
|
||||
try_files $uri =404;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
# Nginx php-fpm config:
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
|
||||
}
|
||||
client_max_body_size 15M;
|
||||
server_tokens off;
|
||||
|
||||
# Hide PHP headers
|
||||
fastcgi_hide_header X-Powered-By;
|
||||
fastcgi_hide_header X-CF-Powered-By;
|
||||
fastcgi_hide_header X-Runtime;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
gzip_static on;
|
||||
}
|
||||
# deny access to Apache .htaccess on Nginx with PHP,
|
||||
# if Apache and Nginx document roots concur
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
location ~ .*\.(?!htaccess).* {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
3
src/index.php
Normal file
3
src/index.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
phpinfo();
|
||||
?>
|
||||
6
src/php.ini
Normal file
6
src/php.ini
Normal file
@@ -0,0 +1,6 @@
|
||||
date.timezone=UTC
|
||||
display_errors=Off
|
||||
log_errors=On
|
||||
upload_max_filesize= 80M
|
||||
post_max_size= 80M
|
||||
memory_limit = 256M
|
||||
Reference in New Issue
Block a user