comparison xml/ru/docs/example.xml @ 76:4a4caa566120

Russian documentation import. Changes in module.dtd: <example> now allowed to contain <value> and <emphasis> elements (we need this to show important parts in examples), less strict checking of <directive> syntax (we don't want to fully document some directives, notably deprecated ones). Known issues: 1. <syntax> elements are preserved as is, they will require manual conversion (likely to some not-yet-existed format a la DocBook cmdsynopsis, as currently used one seems to be incomplete); 2. <value> no longer corresponds to replaceable content, and it's use in examples isn't correct; 3. <link doc="document#fragment"> doesn't work with current xslt, either should be supported or changed to <link doc="document" id="fragment">. The following files are intentionally omitted: maillists.xml (support.xml should be used instead), experimental.xml (obsolete), faq.xml (conflicts with existing one, needs discussion). Not yet linked to site.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 11 Oct 2011 12:57:50 +0000
parents
children 7db449e89e92
comparison
equal deleted inserted replaced
75:2bf4cd2787c5 76:4a4caa566120
1 <!DOCTYPE article SYSTEM "../../../dtd/article.dtd">
2
3 <article title="Пример конфигурации nginx"
4 link="/ru/docs/example.html"
5 lang="ru">
6
7 <section>
8
9 <para>
10 Пример конфигурации сайта, который передаёт все запросы бэкенду, кроме
11 картинок и запросов, начинающихся с "/download/".
12 <!--
13 Директивы, выделенные цветом, скорее всего, будут меняться в будущих версиях.
14 -->
15 <programlisting>
16 user www www;
17
18 worker_processes 2;
19
20 pid /var/run/nginx.pid;
21
22 # [ debug | info | notice | warn | error | crit ]
23
24 error_log /var/log/nginx.error_log info;
25
26 events {
27 connections 2000;
28
29 # use [ kqueue | rtsig | epoll | /dev/poll | select | poll ];
30 use kqueue;
31 }
32
33 http {
34
35 include conf/mime.types;
36 default_type application/octet-stream;
37
38
39 log_format main '$remote_addr - $remote_user [$time_local] '
40 '"$request" $status $bytes_sent '
41 '"$http_referer" "$http_user_agent" '
42 '"$gzip_ratio"';
43
44 log_format download '$remote_addr - $remote_user [$time_local] '
45 '"$request" $status $bytes_sent '
46 '"$http_referer" "$http_user_agent" '
47 '"$http_range" "$sent_http_content_range"';
48
49 client_header_timeout 3m;
50 client_body_timeout 3m;
51 send_timeout 3m;
52 <!--
53 connection_pool_size 256;
54 -->
55 client_header_buffer_size 1k;
56 large_client_header_buffers 4 4k;
57 <!--
58 request_pool_size 4k;
59 -->
60 gzip on;
61 gzip_min_length 1100;
62 gzip_buffers 4 8k;
63 gzip_types text/plain;
64
65 output_buffers 1 32k;
66 postpone_output 1460;
67
68 sendfile on;
69 tcp_nopush on;
70 tcp_nodelay on;
71 send_lowat 12000;
72
73 keepalive_timeout 75 20;
74
75 #lingering_time 30;
76 #lingering_timeout 10;
77 #reset_timedout_connection on;
78
79
80 server {
81 listen one.example.com;
82 server_name one.example.com www.one.example.com;
83
84 access_log /var/log/nginx.access_log main;
85
86 location / {
87 proxy_pass http://127.0.0.1/;
88 proxy_redirect off;
89
90 proxy_set_header Host $host;
91 proxy_set_header X-Real-IP $remote_addr;
92 #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
93
94 client_max_body_size 10m;
95 client_body_buffer_size 128k;
96
97 client_body_temp_path /var/nginx/client_body_temp;
98
99 proxy_connect_timeout 70;
100 proxy_send_timeout 90;
101 proxy_read_timeout 90;
102 proxy_send_lowat 12000;
103
104 proxy_buffer_size 4k;
105 proxy_buffers 4 32k;
106 proxy_busy_buffers_size 64k;
107 proxy_temp_file_write_size 64k;
108
109 proxy_temp_path /var/nginx/proxy_temp;
110
111 charset koi8-r;
112 }
113
114 error_page 404 /404.html;
115
116 location /404.html {
117 root /spool/www;
118
119 charset on;
120 source_charset koi8-r;
121 }
122
123 location /old_stuff/ {
124 rewrite ^/old_stuff/(.*)$ /new_stuff/$1 permanent;
125 }
126
127 location /download/ {
128
129 valid_referers none blocked server_names *.example.com;
130
131 if ($invalid_referer) {
132 #rewrite ^/ http://www.example.com/;
133 return 403;
134 }
135
136 #rewrite_log on;
137
138 # rewrite /download/*/mp3/*.any_ext to /download/*/mp3/*.mp3
139 rewrite ^/(download/.*)/mp3/(.*)\..*$
140 /$1/mp3/$2.mp3 break;
141
142 root /spool/www;
143 #autoindex on;
144 access_log /var/log/nginx-download.access_log download;
145 }
146
147 location ~* \.(jpg|jpeg|gif)$ {
148 root /spool/www;
149 access_log off;
150 expires 30d;
151 }
152 }
153 }
154 </programlisting>
155 </para>
156
157 </section>
158
159 </article>