|
1 | | -server { |
2 | | - listen 8080; |
3 | | - server_name _; |
| 1 | +events { |
| 2 | + worker_connections 1024; |
| 3 | +} |
4 | 4 |
|
5 | | - root /var/www/html/public; |
6 | | - index index.php index.html; |
| 5 | +http { |
| 6 | + include /etc/nginx/mime.types; |
| 7 | + default_type application/octet-stream; |
7 | 8 |
|
8 | | - access_log /var/log/nginx/access.log; |
9 | | - error_log /var/log/nginx/error.log warn; |
| 9 | + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
| 10 | + '$status $body_bytes_sent "$http_referer" ' |
| 11 | + '"$http_user_agent" "$http_x_forwarded_for"'; |
10 | 12 |
|
11 | | - location / { |
12 | | - try_files $uri $uri/ /index.php?$query_string; |
13 | | - } |
| 13 | + access_log /var/log/nginx/access.log main; |
| 14 | + error_log /var/log/nginx/error.log warn; |
14 | 15 |
|
15 | | - location ~ \.php$ { |
16 | | - include fastcgi_params; |
17 | | - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
18 | | - fastcgi_pass 127.0.0.1:9000; |
19 | | - fastcgi_index index.php; |
20 | | - } |
| 16 | + sendfile on; |
| 17 | + keepalive_timeout 65; |
21 | 18 |
|
22 | | - location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2)$ { |
23 | | - expires 30d; |
24 | | - add_header Cache-Control "public, no-transform"; |
25 | | - } |
| 19 | + server { |
| 20 | + listen 8080; |
| 21 | + server_name _; |
| 22 | + |
| 23 | + root /var/www/html/public; |
| 24 | + index index.php index.html; |
26 | 25 |
|
27 | | - client_max_body_size 20m; |
| 26 | + location / { |
| 27 | + try_files $uri $uri/ /index.php?$query_string; |
| 28 | + } |
| 29 | + |
| 30 | + location ~ \.php$ { |
| 31 | + include fastcgi_params; |
| 32 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 33 | + fastcgi_pass 127.0.0.1:9000; |
| 34 | + fastcgi_index index.php; |
| 35 | + } |
| 36 | + |
| 37 | + location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2)$ { |
| 38 | + expires 30d; |
| 39 | + add_header Cache-Control "public, no-transform"; |
| 40 | + } |
| 41 | + |
| 42 | + client_max_body_size 20m; |
| 43 | + } |
28 | 44 | } |
29 | 45 |
|
30 | 46 |
|
0 commit comments