|
1 #user nobody; |
|
2 worker_processes 1; |
|
3 |
|
4 #error_log logs/error.log; |
|
5 #error_log logs/error.log notice; |
|
6 #error_log logs/error.log info; |
|
7 |
|
8 #pid logs/nginx.pid; |
|
9 |
|
10 events { |
|
11 worker_connections 1024; |
|
12 } |
|
13 |
|
14 http { |
|
15 |
|
16 server { |
|
17 listen 80; |
|
18 server_name {{ site_name }}; |
|
19 root /code/src/public; |
|
20 |
|
21 index index.html index.htm index.php; |
|
22 |
|
23 charset utf-8; |
|
24 |
|
25 location / { |
|
26 try_files $uri $uri/ /index.php?$query_string; |
|
27 } |
|
28 |
|
29 location = /favicon.ico { access_log off; log_not_found off; } |
|
30 location = /robots.txt { access_log off; log_not_found off; } |
|
31 |
|
32 access_log off; |
|
33 error_log /var/log/nginx/{{ site_name }}-error.log error; |
|
34 |
|
35 sendfile off; |
|
36 |
|
37 client_max_body_size 100m; |
|
38 |
|
39 location ~ \.php$ { |
|
40 fastcgi_split_path_info ^(.+\.php)(/.+)$; |
|
41 fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; |
|
42 fastcgi_index index.php; |
|
43 include fastcgi_params; |
|
44 fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; |
|
45 fastcgi_param PATH_TRANSLATED $document_root/$fastcgi_script_name; |
|
46 fastcgi_intercept_errors off; |
|
47 fastcgi_buffer_size 16k; |
|
48 fastcgi_buffers 4 16k; |
|
49 } |
|
50 |
|
51 location ~ /\.ht { |
|
52 deny all; |
|
53 } |
|
54 } |
|
55 server { |
|
56 listen 443; |
|
57 server_name {{ site_name }}; |
|
58 root /code/src/public; |
|
59 |
|
60 index index.html index.htm index.php; |
|
61 |
|
62 charset utf-8; |
|
63 |
|
64 location / { |
|
65 try_files $uri $uri/ /index.php?$query_string; |
|
66 } |
|
67 |
|
68 location = /favicon.ico { access_log off; log_not_found off; } |
|
69 location = /robots.txt { access_log off; log_not_found off; } |
|
70 |
|
71 access_log off; |
|
72 error_log /var/log/nginx/{{ site_name }}-ssl-error.log error; |
|
73 |
|
74 sendfile off; |
|
75 |
|
76 client_max_body_size 100m; |
|
77 |
|
78 location ~ \.php$ { |
|
79 fastcgi_split_path_info ^(.+\.php)(/.+)$; |
|
80 fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; |
|
81 fastcgi_index index.php; |
|
82 include fastcgi_params; |
|
83 fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; |
|
84 fastcgi_param PATH_TRANSLATED $document_root/$fastcgi_script_name; |
|
85 fastcgi_intercept_errors off; |
|
86 fastcgi_buffer_size 16k; |
|
87 fastcgi_buffers 4 16k; |
|
88 } |
|
89 |
|
90 location ~ /\.ht { |
|
91 deny all; |
|
92 } |
|
93 |
|
94 ssl on; |
|
95 ssl_certificate /etc/nginx/ssl/{{ site_name }}.crt; |
|
96 ssl_certificate_key /etc/nginx/ssl/{{ site_name }}.key; |
|
97 } |
|
98 |
|
99 } |