Skip to content

Instantly share code, notes, and snippets.

@samhk222
Created September 13, 2018 13:35
Show Gist options
  • Save samhk222/432012b83d4fa58df5b216e03055cb5e to your computer and use it in GitHub Desktop.
Save samhk222/432012b83d4fa58df5b216e03055cb5e to your computer and use it in GitHub Desktop.
server {
listen 80 default;
client_max_body_size 108M;
#server_name apps.4yousee.com.br;
root /application/public;
#index index.php;
location / {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass php-fpm:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param PHP_VALUE "error_log=/var/log/nginx/application_php_errors.log";
#fastcgi_buffers 16 16k;
#fastcgi_buffer_size 32k;
#fastcgi_split_path_info ^(.+\.php)(/.*)$;
internal;
}
# return 404 for all other php files not matching the front controller
# this prevents access to other php files you don't want to be accessible.
location ~ \.php$ {
return 404;
}
access_log /var/log/nginx/application.access.log;
error_log /var/log/nginx/project_error.log;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment