Skip to content

Commit 0a5ab31

Browse files
committed
Merge branch 'release/1.0.11'
2 parents bbd3526 + 9ad3918 commit 0a5ab31

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Nginx-Craft Changelog
22

3+
## 1.0.11 - 2017.10.02
4+
### Added
5+
* Added a `basic_localdev.com.conf` for people who just want a basic Nginx configuration for Craft local dev
6+
37
## 1.0.10 - 2017.09.12
48
### Changed
59
* Updated the config to use php7.1 by default

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ If you're using Forge, understand that `opcache` is off by default. To enable it
9090

9191
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.
9292

93+
## Local Development
94+
95+
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.
96+
97+
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`.
98+
99+
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.
100+
93101
## Miscellanea
94102

95103
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`:
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Nginx-Craft virtual host configuration file
2+
# @author nystudio107
3+
# @copyright Copyright (c) 2016 nystudio107
4+
# @link https://nystudio107.com/
5+
# @package nginx-craft
6+
# @since 1.0.11
7+
# @license MIT
8+
9+
# This is a BASIC Nginx config for Craft, suitable for use in for local development
10+
# DO NOT use this config in production, it is not performant. Instead, use the
11+
# somedomain.com.conf config
12+
server {
13+
# Listen for both IPv4 & IPv6 on port 80
14+
listen 80;
15+
listen [::]:80;
16+
17+
# General virtual host settings
18+
server_name SOMEDOMAIN.com;
19+
root "/var/www/SOMEDOMAIN/public";
20+
index index.html index.htm index.php;
21+
charset utf-8;
22+
23+
# 404 error handler
24+
error_page 404 /index.php?$query_string;
25+
26+
# Access and error logging
27+
access_log off;
28+
error_log /var/log/nginx/SOMEDOMAIN.com-error.log error;
29+
# If you want error logging to go to SYSLOG (for services like Papertrailapp.com), uncomment the following:
30+
#error_log syslog:server=unix:/dev/log,facility=local7,tag=nginx,severity=error;
31+
32+
# Root directory location handler
33+
location / {
34+
try_files $uri/index.html $uri $uri/ /index.php?$query_string;
35+
}
36+
37+
# php-fpm configuration
38+
location ~ [^/]\.php(/|$) {
39+
try_files $uri $uri/ /index.php?$query_string;
40+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
41+
# Change this to whatever version of php you are using
42+
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
43+
fastcgi_index index.php;
44+
include fastcgi_params;
45+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
46+
fastcgi_param PATH_INFO $fastcgi_path_info;
47+
fastcgi_param HTTP_PROXY "";
48+
49+
fastcgi_intercept_errors off;
50+
fastcgi_buffer_size 16k;
51+
fastcgi_buffers 4 16k;
52+
fastcgi_connect_timeout 300;
53+
fastcgi_send_timeout 300;
54+
fastcgi_read_timeout 300;
55+
}
56+
57+
# Disable reading of Apache .htaccess files
58+
location ~ /\.ht {
59+
deny all;
60+
}
61+
62+
# Misc settings
63+
sendfile off;
64+
client_max_body_size 100m;
65+
}

0 commit comments

Comments
 (0)