Skip to content

Commit e43514b

Browse files
author
Michael Gorianskyi
committed
Moved to organisation and splitted into subprojects
1 parent fb2da0f commit e43514b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+267
-245
lines changed

.dockerignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

.gitignore

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
src/sites-available/*
2-
!src/sites-available/invalid.conf
3-
!src/sites-available/example.com.conf
4-
src/sites-enabled/*
5-
!src/sites-enabled/invalid.conf
6-
!src/sites-enabled/example.com.conf
7-
node_modules
1+
sites-available/*
2+
!sites-available/default.conf
3+
!sites-available/nginx.boilerplate.conf
4+
sites-enabled/*
5+
!sites-enabled/default.conf
6+
!sites-enabled/nginx.boilerplate.conf
87
.idea
8+
.DS_Store

LICENSE renamed to LICENSE.md

Lines changed: 1 addition & 1 deletion

README.md

Lines changed: 6 additions & 20 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/nginx-bp/enable/php.conf renamed to boilerplate/enable/php.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include nginx-bp/fastcgi_params;
1+
include boilerplate/fastcgi_params;
22

33
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
44
if ($uri ~ ^(?<script_name>.+\.php)?(?<path_info>/.*)?$) {}
@@ -20,9 +20,9 @@ if ($script_name != '')
2020
}
2121
fastcgi_param SCRIPT_FILENAME $document_root$script_name_final;
2222

23-
# If the actual target php script doesn't exist
23+
# If the actual target php script doesn't exist and php is running on the same server
2424
if (!-e $document_root$script_name_final) {
25-
return 404;
25+
#return 404;
2626
}
2727

2828
# override SCRIPT_NAME which is set to $fastcgi_script_name
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Use "off" for local development.
22
open_file_cache max=300;
3-
open_file_cache_errors on;
3+
open_file_cache_errors on;

src/nginx-bp/limits/timeouts.conf renamed to boilerplate/limits/timeouts.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ client_body_timeout 5;
44
send_timeout 5;
55

66
fastcgi_connect_timeout 5;
7-
fastcgi_send_timeout 5;
7+
fastcgi_send_timeout 5;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
location /
22
{
33
try_files $uri $uri/ @php;
4-
}
4+
}
File renamed without changes.

boilerplate/locations/static.conf

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
2+
expires -1;
3+
}
4+
5+
location ~* \.(?:rss|atom)$ {
6+
expires 1h;
7+
access_log off;
8+
log_not_found off;
9+
sendfile on;
10+
tcp_nopush on;
11+
tcp_nodelay off;
12+
add_header Cache-Control "public";
13+
}
14+
15+
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
16+
expires 1M;
17+
access_log off;
18+
log_not_found off;
19+
sendfile on;
20+
tcp_nopush on;
21+
tcp_nodelay off;
22+
add_header Cache-Control "public";
23+
}
24+
25+
location ~* \.(?:css|js)$ {
26+
expires 1y;
27+
access_log off;
28+
log_not_found off;
29+
sendfile on;
30+
tcp_nopush on;
31+
tcp_nodelay off;
32+
add_header Cache-Control "public";
33+
}
34+
35+
location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
36+
expires 1M;
37+
access_log off;
38+
log_not_found off;
39+
sendfile on;
40+
tcp_nopush on;
41+
tcp_nodelay off;
42+
add_header Cache-Control "public";
43+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/nginx-bp/system/http.conf renamed to boilerplate/system/http.conf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,4 @@ index index.html index.htm index.php;
77
reset_timedout_connection on;
88
keepalive_disable none;
99

10-
sendfile on;
11-
tcp_nopush on;
12-
tcp_nodelay off;
13-
keepalive_requests 20;
10+
keepalive_requests 20;

src/nginx-bp/system/os.conf renamed to boilerplate/system/os.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# By default specified user needs access to the following locations:
2-
# - document root (e.g. /var/www/nginx-bp/test)
2+
# - document root (e.g. /var/www/boilerplate/test)
33
# - php-fpm socket, if applicable (e.g. /var/run/php-fpm/php-fpm.sock)
44
# - fast-cgi cache directory (e.g. /tmp - see fastcgi_cache_path in limits/zones.conf for cache zone definition)
55
# - fast-cgi temp directory (e.g. /var/lib/nginx/fastcgi/*)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
upstream nginx.boilerplate
2+
{
3+
server php.nginx.boilerplate:9000 max_fails=3 fail_timeout=3s;
4+
#ip_hash;
5+
#keepalive 16;
6+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docker-compose.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

nginx.conf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
include boilerplate/system/os.conf;
2+
include boilerplate/system/processes.conf;
3+
4+
events
5+
{
6+
include boilerplate/system/connections.conf;
7+
}
8+
9+
http
10+
{
11+
include boilerplate/mime.types;
12+
13+
include boilerplate/limits/hashes.conf;
14+
include boilerplate/limits/open_files_cache.conf;
15+
include boilerplate/limits/timeouts.conf;
16+
17+
include boilerplate/system/http.conf;
18+
19+
include boilerplate/logs/formats.conf;
20+
include boilerplate/logs/error.conf;
21+
22+
include boilerplate/maps/*.conf;
23+
include boilerplate/upstreams/*.conf;
24+
include boilerplate/zones/*.conf;
25+
26+
include sites-enabled/*.conf;
27+
}
File renamed without changes.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
server
2+
{
3+
server_name www.nginx.boilerplate;
4+
5+
listen 80;
6+
7+
#listen 443 ssl;
8+
#include boilerplate/enable/ssl.conf;
9+
#ssl_certificate /etc/nginx/certs/server.crt;
10+
#ssl_certificate_key /etc/nginx/certs/server.key;
11+
12+
access_log off;
13+
log_not_found off;
14+
15+
return 301 http://nginx.boilerplate$request_uri;
16+
}
17+
18+
server
19+
{
20+
server_name nginx.boilerplate;
21+
22+
root /var/www/nginx.boilerplate/;
23+
listen 80;
24+
25+
#listen 443 ssl;
26+
#include boilerplate/enable/ssl.conf;
27+
#ssl_certificate /etc/nginx/certs/server.crt;
28+
#ssl_certificate_key /etc/nginx/certs/server.key;
29+
30+
include boilerplate/enable/uploads.conf;
31+
include boilerplate/enable/gzip.conf;
32+
include boilerplate/locations/system.conf;
33+
include boilerplate/locations/errors.conf;
34+
include boilerplate/limits/methods.conf;
35+
#include boilerplate/limits/access.conf;
36+
37+
location @php
38+
{
39+
# PHP enabled?
40+
include boilerplate/enable/php.conf;
41+
fastcgi_pass nginx.boilerplate;
42+
43+
# Use this instead if Php is off
44+
#include boilerplate/disable/php.conf;
45+
46+
#Php caching
47+
#include boilerplate/enable/php_cache.conf;
48+
#fastcgi_cache_valid 200 301 302 304 1h;
49+
#fastcgi_cache_min_uses 3;
50+
51+
#Php request limiting?
52+
limit_req zone=reqPerSec10 burst=50 nodelay;
53+
limit_conn conPerIp 10;
54+
}
55+
56+
location ~ ^.+\.php(?:/.*)?$
57+
{
58+
try_files !noop! @php;
59+
}
60+
61+
# Log bots?
62+
access_log /var/log/nginx/nginx.boilerplate.bots.log main if=$is_bot buffer=10k flush=1s;
63+
# Log humans?
64+
access_log /var/log/nginx/nginx.boilerplate.access.log main if=!$is_bot buffer=10k flush=1s;
65+
# Error logging
66+
error_log /var/log/nginx/nginx.boilerplate.error.log debug;
67+
68+
# Static requests limiting
69+
limit_req zone=reqPerSec20 burst=100 nodelay;
70+
limit_conn conPerIp 20;
71+
72+
include boilerplate/locations/default.conf;
73+
include boilerplate/locations/static.conf;
74+
}

sites-enabled/default.conf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Server definition to handle requests to undefined hosts
2+
# Don't change this file, unless you know what you are doing
3+
# Use sites-available/example.conf as base for your own configs
4+
server
5+
{
6+
root "";
7+
server_name "";
8+
access_log off;
9+
log_not_found off;
10+
listen 80 default_server;
11+
12+
location /nginx_status {
13+
stub_status on;
14+
allow 127.0.0.1;
15+
deny all;
16+
}
17+
18+
location / {
19+
return 444;
20+
}
21+
}

sites-enabled/nginx.boilerplate.conf

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
server
2+
{
3+
server_name www.nginx.boilerplate;
4+
5+
listen 80;
6+
7+
#listen 443 ssl;
8+
#include boilerplate/enable/ssl.conf;
9+
#ssl_certificate /etc/nginx/certs/server.crt;
10+
#ssl_certificate_key /etc/nginx/certs/server.key;
11+
12+
access_log off;
13+
log_not_found off;
14+
15+
return 301 http://nginx.boilerplate$request_uri;
16+
}
17+
18+
server
19+
{
20+
server_name nginx.boilerplate;
21+
22+
root /var/www/nginx.boilerplate/;
23+
listen 80;
24+
25+
#listen 443 ssl;
26+
#include boilerplate/enable/ssl.conf;
27+
#ssl_certificate /etc/nginx/certs/server.crt;
28+
#ssl_certificate_key /etc/nginx/certs/server.key;
29+
30+
include boilerplate/enable/uploads.conf;
31+
include boilerplate/enable/gzip.conf;
32+
include boilerplate/locations/system.conf;
33+
include boilerplate/locations/errors.conf;
34+
include boilerplate/limits/methods.conf;
35+
#include boilerplate/limits/access.conf;
36+
37+
location @php
38+
{
39+
# PHP enabled?
40+
include boilerplate/enable/php.conf;
41+
fastcgi_pass nginx.boilerplate;
42+
43+
# Use this instead if Php is off
44+
#include boilerplate/disable/php.conf;
45+
46+
#Php caching
47+
#include boilerplate/enable/php_cache.conf;
48+
#fastcgi_cache_valid 200 301 302 304 1h;
49+
#fastcgi_cache_min_uses 3;
50+
51+
#Php request limiting?
52+
limit_req zone=reqPerSec10 burst=50 nodelay;
53+
limit_conn conPerIp 10;
54+
}
55+
56+
location ~ ^.+\.php(?:/.*)?$
57+
{
58+
try_files !noop! @php;
59+
}
60+
61+
# Log bots?
62+
access_log /var/log/nginx/nginx.boilerplate.bots.log main if=$is_bot buffer=10k flush=1s;
63+
# Log humans?
64+
access_log /var/log/nginx/nginx.boilerplate.access.log main if=!$is_bot buffer=10k flush=1s;
65+
# Error logging
66+
error_log /var/log/nginx/nginx.boilerplate.error.log debug;
67+
68+
# Static requests limiting
69+
limit_req zone=reqPerSec20 burst=100 nodelay;
70+
limit_conn conPerIp 20;
71+
72+
include boilerplate/locations/default.conf;
73+
include boilerplate/locations/static.conf;
74+
}

0 commit comments

Comments
 (0)