| 1 |
user www www; |
| 2 |
worker_processes 2; |
| 3 |
pid /var/run/nginx.pid; |
| 4 |
error_log /var/log/nginx.error_log debug | info | notice | warn | error | crit; |
| 5 |
|
| 6 |
events { |
| 7 |
connections 2000; |
| 8 |
use kqueue | rtsig | epoll | /dev/poll | select | poll; |
| 9 |
} |
| 10 |
|
| 11 |
http { |
| 12 |
log_format main '$remote_addr - $remote_user [$time_local] ' |
| 13 |
'"$request" $status $bytes_sent ' |
| 14 |
'"$http_referer" "$http_user_agent" ' |
| 15 |
'"$gzip_ratio"'; |
| 16 |
|
| 17 |
send_timeout 3m; |
| 18 |
client_header_buffer_size 1k; |
| 19 |
|
| 20 |
gzip on; |
| 21 |
gzip_min_length 1100; |
| 22 |
|
| 23 |
#lingering_time 30; |
| 24 |
|
| 25 |
server { |
| 26 |
server_name one.example.com www.one.example.com; |
| 27 |
access_log /var/log/nginx.access_log main; |
| 28 |
|
| 29 |
rewrite (.*) /index.php?page=$1 break; |
| 30 |
|
| 31 |
location / { |
| 32 |
proxy_pass http://127.0.0.1/; |
| 33 |
proxy_redirect off; |
| 34 |
proxy_set_header Host $host; |
| 35 |
proxy_set_header X-Real-IP $remote_addr; |
| 36 |
charset koi8-r; |
| 37 |
} |
| 38 |
|
| 39 |
location /api/ { |
| 40 |
fastcgi_pass 127.0.0.1:9000; |
| 41 |
} |
| 42 |
|
| 43 |
location ~* \.(jpg|jpeg|gif)$ { |
| 44 |
root /spool/www; |
| 45 |
} |
| 46 |
} |
| 47 |
} |