Skip to content

Commit

Permalink
Merge branch 'release/1.0.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Oct 2, 2017
2 parents bbd3526 + 9ad3918 commit 0a5ab31
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Nginx-Craft Changelog

## 1.0.11 - 2017.10.02
### Added
* Added a `basic_localdev.com.conf` for people who just want a basic Nginx configuration for Craft local dev

## 1.0.10 - 2017.09.12
### Changed
* Updated the config to use php7.1 by default
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ If you're using Forge, understand that `opcache` is off by default. To enable it

More about tweaking `opcache` can be found in the [Fine-Tune Your Opcache Configuration to Avoid Caching Suprises](https://tideways.io/profiler/blog/fine-tune-your-opcache-configuration-to-avoid-caching-suprises) article. The [Best Zend OpCache Settings/Tuning/Config](https://www.scalingphpbook.com/blog/2014/02/14/best-zend-opcache-settings.html) article is very useful as well.

## Local Development

While all of the configuration in the `somedomain.com.conf` will work fine in local development as well, some people might want a simpler setup for local development.

There is a `basic_localdev.com.conf` that you can use for a basic Nginx configuration that will work with Craft without any of the bells, whistles, or optimizations found in the `somedomain.com.conf`.

While this is suitable for getting up and running quickly for local development, do not use it in production. There are a number of performance optimizations missing from it.

## Miscellanea

If you encounter a problem where large asset uploads fail, despite `memory_limit`, `post_max_size` and `upload_max_filesize` being set properly in your `php.ini`, you may need to add the following to the `http {}` block of the main `nginx.conf`:
Expand Down
65 changes: 65 additions & 0 deletions sites-available/basic_localdev.com.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Nginx-Craft virtual host configuration file
# @author nystudio107
# @copyright Copyright (c) 2016 nystudio107
# @link https://nystudio107.com/
# @package nginx-craft
# @since 1.0.11
# @license MIT

# This is a BASIC Nginx config for Craft, suitable for use in for local development
# DO NOT use this config in production, it is not performant. Instead, use the
# somedomain.com.conf config
server {
# Listen for both IPv4 & IPv6 on port 80
listen 80;
listen [::]:80;

# General virtual host settings
server_name SOMEDOMAIN.com;
root "/var/www/SOMEDOMAIN/public";
index index.html index.htm index.php;
charset utf-8;

# 404 error handler
error_page 404 /index.php?$query_string;

# Access and error logging
access_log off;
error_log /var/log/nginx/SOMEDOMAIN.com-error.log error;
# If you want error logging to go to SYSLOG (for services like Papertrailapp.com), uncomment the following:
#error_log syslog:server=unix:/dev/log,facility=local7,tag=nginx,severity=error;

# Root directory location handler
location / {
try_files $uri/index.html $uri $uri/ /index.php?$query_string;
}

# php-fpm configuration
location ~ [^/]\.php(/|$) {
try_files $uri $uri/ /index.php?$query_string;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Change this to whatever version of php you are using
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTP_PROXY "";

fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
}

# Disable reading of Apache .htaccess files
location ~ /\.ht {
deny all;
}

# Misc settings
sendfile off;
client_max_body_size 100m;
}

0 comments on commit 0a5ab31

Please sign in to comment.