-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
127 lines (101 loc) · 3.88 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# nginx Main Configuration File
# Settings that are global to http scope resides in this config file.
# On first use, overwrite the contents of /etc/nginx with these files.
# This file must be concise at all times; verbose configuration
# should be included from separate configuration files.
# See below for reference.
# To properly use this template without modification,
# you should create /var/www and move contents of to
# this folder, and delete it. Then, create a symlink to /var/www
# at /usr/share/nginx.
# You should also generate a DH parameter file at /etc/ssl/dhparam.pem
# (preferably over 4096 bits)
#user html;
worker_processes 1;
#error_log logs/error.log;
error_log /var/log/nginx/error.log warn;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
client_max_body_size 5m;
#gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
application/atom+xml
application/javascript
application/json
application/ld+json
application/manifest+json
application/rss+xml
application/vnd.geo+json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/bmp
image/svg+xml
image/x-icon
text/cache-manifest
text/css
text/plain
text/vcard
text/vnd.rim.location.xloc
text/vtt
text/x-component
text/x-cross-domain-policy
;
server_names_hash_bucket_size 64;
server_tokens off; # https://gist.github.com/plentz/6737338
# Referenced http://stackoverflow.com/questions/21230918/nginx-scheme-variable-behind-load-balancer
map $http_x_forwarded_proto $real_scheme {
default $http_x_forwarded_proto;
'' $scheme;
}
# Referenced https://github.com/heroku/heroku-buildpack-php/blob/master/conf/nginx/heroku.conf.php
upstream php-fcgi {
server unix:/run/php-fpm/php-fpm.sock max_fails=3 fail_timeout=3s;
keepalive 16;
}
# Additional Configuration Files:
# Configuration local to each sites, or virtual hosts reside in
# Configuration/Sites directory.
# To create new sites, you may copy and modify the templates in
# Configuration/Sites/Templates directory.
# They were put in effort to provide sane defaults.
# Disabled Sites goes to 'Configuration/Disabled Sites',
# but this is just an convention and actually does nothing.
# Directly references settings from other places should
# have file by itself for easy version management.
# Configuration too long for this file reside in
# Configuration/Global.
# Settings common to each server scopes (and for DRY) reside in
# Configuration/Common.
# Configuration/Common/Meta contains meta-configuration files that
# has no or little settings itself but combine other files that are
# often used in combination.
# With namespaces as the words before the first dot,
# common domain-specific settings should have their own files.
# In a namespace, settings that are optional or that should be in
# different scopes should have their own files.
# Refer to stock settings for example.
include Configuration/Global/*.conf;
include Configuration/Sites/*.conf;
}