<div dir="ltr">Переменные - совсем зло? <br><br>Переделал все на без srv_root - все работает.<br><br>Остался только один вопрос.<br><br>...<br><br>location / {<br>&nbsp;&nbsp; index index.php;<br>}<br><br>location ~* \.php$ {<br>&nbsp; include /etc/nginx/www/include/fastcgi_params.conf;<br>

}<br>...<br><br>В таком случае, есть какой-нить элегантный способ, чтобы *.php файлы в локейшене /uploads/ не уходили на fastcgi?<br><br>location /uploads/ {<br>
&nbsp;&nbsp; location ~* \.php$ {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; deny all;<br>
&nbsp;&nbsp; }<br>
}<br>
<br>
&nbsp;как-то некошерненько :(<br><br><br>Раньше, у меня это работало через <br><br>location /uploads/ {<br>&nbsp;&nbsp; root $srv_root;<br>
}<br><br>Если попробовать: root $document_root<br>the $document_root variable may not be used in the &quot;root&quot; directive<br><br>Спасибо.<br><br><br><div class="gmail_quote">21 августа 2008 г. 17:31 пользователь Igor Sysoev <span dir="ltr">&lt;<a href="mailto:is@rambler-co.ru" target="_blank">is@rambler-co.ru</a>&gt;</span> написал:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On Thu, Aug 21, 2008 at 05:25:19PM +0400, Владислав Комиссаров wrote:<br>
<br>
&gt; Заметил в error.log следующую ошибку:<br>
&gt;<br>
&gt; 2008/08/21 16:49:12 [crit] 31836#0: *316 rename()<br>
&gt; &quot;/var/tmp/nginx/fastcgi/3/04/0000000043&quot; to<br>
&gt; &quot;/var/www/phpMyAdmin/navigation.php&quot; failed (13: Permission denied) while<br>
&gt; reading upstream, client: <a href="http://89.175.80.253" target="_blank">89.175.80.253</a>, server: <a href="http://mysql.domain.ru" target="_blank">mysql.domain.ru</a>, request:<br>
&gt; &quot;GET /navigation.php?token=83f3ab3525f0dba8d3aba091e4004678 HTTP/1.1&quot;,<br>
&gt; upstream: &quot;fastcgi://unix:/var/run/php.sock:&quot;, host: &quot;<a href="http://mysql.domain.ru" target="_blank">mysql.domain.ru</a>&quot;,<br>
&gt; referrer: &quot;<a href="http://mysql.domain.ru/" target="_blank">http://mysql.domain.ru/</a>&quot;<br>
&gt;<br>
&gt; Если дать nginx права записи (chown -R www-data:www-data<br>
&gt; /var/www/phpMyAdmin/) &nbsp;то вот кусок того, что становится с файлом.<br>
&gt;<br>
</div>&gt; ^_&lt;8b&gt;^H^@^@^@^@^@^@^C??]yo^[G&lt;96&gt;??_&lt;9f&gt;????&lt;80&gt;,id??I??:-r!Kr??^X_#????d^M&lt;83&gt;i²&lt;8b&gt;b????n??^O^]&lt;99&gt;^M^P;&lt;9b&gt;??.&lt;9c&gt;M2A&lt;80&gt;^M^F&lt;98&gt;??:??????^B²&#39;^;&gt;??^B??&lt;8d&gt;??????&gt;??&amp;??&lt;94&gt;HN??n^C??????^U??z????^]????c????????&lt;8d&gt;&lt;9d&gt;&lt;8f&gt;nl&lt;91&gt;&lt;9a&gt;UW??&lt;8d&gt;[^W??\??<br>



&gt; ??&lt;9c&gt;(??????&lt;86&gt;(n??l&lt;92&gt;^O^???s??<br>
<div>&gt;<br>
&gt; До этого, на его месте был стройненький код пхпмайадмина.<br>
<br>
</div>Ну да, так и должно быть, если используются<br>
<div><br>
 &nbsp; fastcgi_store &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; on;<br>
 &nbsp; fastcgi_store_access &nbsp; &nbsp;user:rw &nbsp;group:rw &nbsp;all:r;<br>
<br>
</div>Что касается $srv_root, то он не нужен:<br>
<br>
- &nbsp; set $srv_root &nbsp; /var/www/phpMyAdmin;<br>
- &nbsp; root $srv_root;<br>
+ &nbsp; root &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/var/www/phpMyAdmin;<br>
<br>
<br>
 &nbsp; &nbsp;location ~* \.php$ {<br>
<br>
- &nbsp; fastcgi_param &nbsp; DOCUMENT_ROOT &nbsp; $srv_root/;<br>
<div>- &nbsp; fastcgi_param &nbsp; SCRIPT_FILENAME $srv_root$fastcgi_script_name;<br>
- &nbsp; fastcgi_param &nbsp; PATH_TRANSLATED $srv_root$fastcgi_script_name;<br>
</div>+ &nbsp; fastcgi_param &nbsp; DOCUMENT_ROOT &nbsp; $document_root/;<br>
+ &nbsp; fastcgi_param &nbsp; SCRIPT_FILENAME $document_root$fastcgi_script_name;<br>
+ &nbsp; fastcgi_param &nbsp; PATH_TRANSLATED $document_root$fastcgi_script_name;<br>
<br>
<br>
 &nbsp; location ~* ^.+.(zip|tgz|gz|rar|bz2 ...<br>
- &nbsp; &nbsp; root &nbsp; &nbsp; $srv_root/;<br>
<div><div></div><div><br>
<br>
&gt; /usr/local/nginx/sbin/nginx -V<br>
&gt; nginx version: nginx/0.7.11<br>
&gt; built by gcc 4.2.3 (Ubuntu 4.2.3-2ubuntu7)<br>
&gt; configure arguments: --conf-path=/etc/nginx/nginx.conf<br>
&gt; --http-log-path=/var/log/nginx/access_log<br>
&gt; --error-log-path=/var/log/nginx/error_log --pid-path=/var/run/nginx.pid<br>
&gt; --http-client-body-temp-path=/var/tmp/nginx/client<br>
&gt; --http-proxy-temp-path=/var/tmp/nginx/proxy<br>
&gt; --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --with-pcre=../pcre-7.7<br>
&gt; --with-zlib=../zlib-1.2.3 --without-select_module --without-http_ssi_module<br>
&gt; --without-http_userid_module --without-http_auth_basic_module<br>
&gt; --without-http_geo_module --without-http_map_module<br>
&gt; --without-http_referer_module --without-http_memcached_module<br>
&gt; --without-http_empty_gif_module --without-http_browser_module<br>
&gt; --without-http_upstream_ip_hash_module --without-mail_pop3_module<br>
&gt; --without-mail_imap_module --without-mail_smtp_module<br>
&gt; --with-http_stub_status_module<br>
&gt;<br>
&gt;<br>
&gt; Конфиг:<br>
&gt;<br>
&gt; server {<br>
&gt; &nbsp; listen &nbsp; &nbsp; &nbsp; &nbsp; 80;<br>
&gt; &nbsp; server_name &nbsp; &nbsp;<a href="http://mysql.domain.ru" target="_blank">mysql.domain.ru</a>;<br>
&gt; &nbsp; set $srv_root &nbsp;/var/www/phpMyAdmin;<br>
&gt;<br>
&gt; &nbsp; root $srv_root;<br>
&gt;<br>
&gt; &nbsp; location / {<br>
&gt; &nbsp; &nbsp; index index.html index.php;<br>
&gt; &nbsp; }<br>
&gt;<br>
&gt; &nbsp; location ~* \.php$ {<br>
&gt; &nbsp; fastcgi_pass &nbsp; unix:/var/run/php.sock;<br>
&gt; &nbsp; fastcgi_index index.php;<br>
&gt; &nbsp; fastcgi_connect_timeout 30;<br>
&gt; &nbsp; fastcgi_send_timeout 300;<br>
&gt;<br>
&gt; &nbsp; fastcgi_read_timeout 300;<br>
&gt; &nbsp; fastcgi_buffer_size 32k;<br>
&gt; &nbsp; fastcgi_buffers 4 32k;<br>
&gt; &nbsp; fastcgi_busy_buffers_size 32k;<br>
&gt; &nbsp; fastcgi_store &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; on;<br>
&gt; &nbsp; fastcgi_store_access &nbsp; &nbsp;user:rw &nbsp;group:rw &nbsp;all:r;<br>
&gt;<br>
&gt; &nbsp; fastcgi_temp_file_write_size 32k;<br>
&gt;<br>
&gt; &nbsp; fastcgi_intercept_errors on;<br>
&gt;<br>
&gt; &nbsp; fastcgi_param &nbsp; DOCUMENT_ROOT &nbsp; $srv_root/;<br>
&gt; &nbsp; fastcgi_param &nbsp; SCRIPT_FILENAME $srv_root$fastcgi_script_name;<br>
&gt; &nbsp; fastcgi_param &nbsp; PATH_TRANSLATED $srv_root$fastcgi_script_name;<br>
&gt; &nbsp; fastcgi_param &nbsp; SCRIPT_NAME &nbsp; &nbsp; $fastcgi_script_name;<br>
&gt; &nbsp; fastcgi_param &nbsp; QUERY_STRING &nbsp; &nbsp;$query_string;<br>
&gt; &nbsp; fastcgi_param &nbsp; REDIRECT_STATUS 200;<br>
&gt;<br>
&gt; &nbsp; fastcgi_param &nbsp; CONTENT_TYPE &nbsp; &nbsp;$content_type;<br>
&gt; &nbsp; fastcgi_param &nbsp; CONTENT_LENGTH &nbsp;$content_length;<br>
&gt;<br>
&gt; &nbsp; fastcgi_param &nbsp; SERVER_ADDR &nbsp; &nbsp; $server_addr;<br>
&gt; &nbsp; fastcgi_param &nbsp; SERVER_PORT &nbsp; &nbsp; $server_port;<br>
&gt; &nbsp; fastcgi_param &nbsp; SERVER_PROTOCOL $server_protocol;<br>
&gt; &nbsp; fastcgi_param &nbsp; SERVER_SOFTWARE &quot;nginx&quot;;<br>
&gt; &nbsp; fastcgi_param &nbsp; GATEWAY_INTERFACE &nbsp; &nbsp; &nbsp; &quot;CGI/1.1&quot;;<br>
&gt; &nbsp; fastcgi_param &nbsp; SERVER_NAME &nbsp; &nbsp; $server_name;<br>
&gt; &nbsp; fastcgi_param &nbsp; REQUEST_URI &nbsp; &nbsp; $request_uri;<br>
&gt; &nbsp; fastcgi_param &nbsp; REQUEST_METHOD &nbsp;$request_method;<br>
&gt; &nbsp; fastcgi_param &nbsp; REMOTE_USER &nbsp; &nbsp; $remote_user;<br>
&gt; &nbsp; fastcgi_param &nbsp; REMOTE_ADDR &nbsp; &nbsp; $remote_addr;<br>
&gt; &nbsp; fastcgi_param &nbsp; REMOTE_PORT &nbsp; &nbsp; $remote_port;<br>
&gt; &nbsp; }<br>
&gt;<br>
&gt; &nbsp; location ~*<br>
&gt; ^.+.(zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|mp3|wmv|avi|swf)$<br>
&gt; {<br>
&gt; &nbsp; &nbsp; &nbsp; root &nbsp; &nbsp; $srv_root/;<br>
&gt; &nbsp; &nbsp; &nbsp; expires &nbsp; &nbsp; &nbsp; &nbsp; 30d;<br>
&gt; &nbsp; }<br>
&gt; }<br>
<br>
</div></div><font color="#888888">--<br>
Игорь Сысоев<br>
<a href="http://sysoev.ru" target="_blank">http://sysoev.ru</a><br>
<br>
</font></blockquote></div><br></div>