Skip to content

Instantly share code, notes, and snippets.

@gerMdz
Last active July 2, 2020 23:17
Show Gist options
  • Save gerMdz/0679cbff7a3270c233ba553c99753eb6 to your computer and use it in GitHub Desktop.
Save gerMdz/0679cbff7a3270c233ba553c99753eb6 to your computer and use it in GitHub Desktop.
nginx site available
server {
server_name alamedacms.local;
root /var/www/html/cms/public;
location / {
try_files $uri /index.php$is_args$args;
}
#DEV
location ~ ^/(index_dev|config)\.php(/|$) {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
#PROD
location ~ ^/index\.php(/|$) {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
location ~ \.php$ {
return 404;
}
error_log /var/log/nginx/mpf_project_error.log;
access_log /var/log/nginx/mpf_project_access.log;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment