-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
65 lines (57 loc) · 2.1 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
# Redirect non-www domains to www. Other redirecting domains can be added to the
# `server_name` line, separated by spaces.
server {
listen 8080;
server_name YOUR_DOMAIN;
return 301 https://www.YOUR_DOMAIN_COM$request_uri;
}
# Any domain name that is not specified in the redirect block above will
# match this block.
server {
listen 8080 default_server;
server_name _;
# Path to the public folder.
root /var/www/public;
# Maximum request body size, this should be the same as `PHP_POST_MAX_SIZE`
# in the Dockerfile.
client_max_body_size 50M;
# Location of the nginx logs.
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
# Gzip settings for compressing the response.
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 1;
gzip_http_version 1.0;
gzip_min_length 10;
gzip_types text/plain text/css application/json application/javascript
text/xml application/xml application/xml+rss text/javascript
image/x-icon application/vnd.ms-fontobject font/opentype
application/x-font-ttf;
gzip_vary on;
gzip_proxied any; # Compression for all requests.
gzip_disable msie6;
# Set client's real IP. Since requests are served from behind AbarCloud load
# balancers, this forwards the user's real IP to the application.
real_ip_recursive on;
real_ip_header X-Forwarded-For;
set_real_ip_from 10.0.0.0/8;
# Try to load the file (if it is a static file) and if the file
# does not exist, forward the request to the PHP app.
location / {
try_files /$uri /index.php$is_args$args;
}
# Configure the options for the PHP-FPM CGI to forward requests to the PHP
# app.
location ~ ^/index\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_read_timeout 600;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
internal;
}
}