我有多个不同的Query_String重写Apache转换为Nginx: ServerName oldsite.com RewriteCond %{QUERY_STRING} ^ubb=showflat&Number=662213$ RewriteRule ^/ubbthreads/ubbthreads.php$ http://newsite.com/1/? [R=301,NC,L] RewriteCond %{QUERY_STRING} ^ubb=showflat&Number=662214$ RewriteRule ^/ubbthreads/ubbthreads.php$ http://newsite.com/2/? [R=301,NC,L] – > server { listen 80; server_name oldsite.com; location ~ /ubbthreads/{ if ($arg = "ubb=showflat&Number=662213"{ rewrite ^ubbthreads/ubbthreads.php http://newsite.com/1/? permanent; } if ($arg = "ubb=showflat&Number=662214"{ rewrite ^ubbthreads/ubbthreads.php http://newsite.com/2/? permanent; } } 那是正确的方法吗? 有没有另一种方法来做到这一点,如果?
我有nginx设置与SSL,并定义了一个proxy_pass指令,以便它通过HTTP代理到支持的系统的某些请求我有兴趣知道是否从后端服务器的响应将到达encryption到客户端。 在发送回客户端之前,nginx会encryption响应吗? 谢谢
我正在运行nginx + php5-fpm。 我的服务器通常速度非常快,但是今天我注意到,网站不时出现10秒到20秒。 并不总是,但有时以502错误网关错误结束。 我调查了日志文件,并得到以下内容:1)(nging日志文件)connect()失败(110:连接超时)连接到上游2)(php5-fpm日志文件)[16-Feb-2013 01:20:53] :[池www]服务器达到pm.max_children设置(5),考虑提高它。 这很奇怪,因为今天我没有太多的在线用户。 有时候我有2倍多,但一切工作正常。 有谁知道如何增加pm.max_children设置? 我检查了/etc/php5/fpm/php-fpm.conf文件,但没有像“pm.max_children设置”。
我正在使用以下设置: CentOS 5.9 Apache与Nginx的静态资源代理 PHP 5.4 FastCGI的 上传较小的文件时,一切正常。 但是,如果我尝试上传较大的文件(我还没有确定切断点),我得到500错误。 我的apache日志设置为E_ALL&〜E_NOTICE&〜E_STRICT&〜E_DEPRECATED 当第一次发生这种情况时,我检查了日志,发现POST超过了fcgi config中的MaxRequestLen。 我迅速地在php.conf文件和cPanel中的post_virtualHost包含文件中更改了这个。 这阻止了错误消息得到logging,但我仍然收到500错误,混淆,没有任何错误相关的logging任何。 从客户端的angular度来看,该文件似乎上传的罚款,并需要很长的时间,因为它应该(HTML5文件API报告进展正常),并在服务器已经收到完整的文件后,长的脚本执行后,500错误生成。 该文件本身是一个大型的文本文件,其中包含几个base64图像,然后拉开服务器端,使用ImageMajick(通过IMajik php扩展)转换成实际的图像文件,然后复制到不同大小的版本与不同级别的过滤/压缩适用于他们。 整个过程可能需要一段时间。 这可能是问题的一部分吗? 如果是的话,我将如何解决? 我的fcgiconfiguration是最新的,如下所示: MaxRequestsPerProcess 1000 FcgidMaxProcesses 200 FcgidProcessLifeTime 7200 MaxProcessCount 500 FcgidIOTimeout 400 FcgidIdleTimeout 600 FcgidIdleScanInterval 90 FcgidBusyTimeout 300 FcgidBusyScanInterval 80 ErrorScanInterval 3 ZombieScanInterval 3 DefaultMinClassProcessCount 0 DefaultMaxClassProcessCount 3 FcgidMaxRequestLen 1073741824 我试图用旧的MaxRequestLenreplaceFcgidMaxRequestLen,但仍然没有运气。 任何帮助将不胜感激。
如何通过在UNIX CLI中查看nginx access.log来获取独特IPv4和IPv6访问者的一些统计信息? 我使用access_log的标准combined预定义格式。
我一直试图让这个工作几个小时,但没有什么似乎工作。 我已经有了一个Drupal站点,并且默认位置如下所示: # Default location location / { try_files $uri @rewrite; } location @rewrite { rewrite_log on; rewrite ^/(.*)$ /index.php?q=$1; } 这工作正常,最终的结果是,所有不直接指向根(如“example.com/subdir1”和“example.com/subdir1/subdir2”)的path被重写为index.php?q = [path]。 但是,恰巧我在网站上有几个子目录,它们是包含index.php文件的“真正的”子目录。 我想testing是否有任何给定的子目录确实有一个index.php,然后运行那个。 这是我认为会奏效的一个尝试: # Default location location / { try_files $uri @subdir @rewrite; } location @subdir { rewrite_log on; rewrite ^/(.*)$ $1/index.php; } location @rewrite { rewrite_log on; rewrite ^/(.*)$ /index.php?q=$1; […]
什么是推荐的path来编译或安装nginx的fastcgi_cache在Ubuntu 12.04 LTS precise ,与最新的nginx-common( 读> =版本1.2.7 )包工程? 或者有没有一种方法可以在debian / ubuntu服务器上完全从头开始有效地编译nginx?
是否可以更改用户尝试导航到服务器上不存在的PHP脚本时显示的消息。 在我的Nginx + PHP-FPMconfiguration中,它显示File not found. 我想用自定义的错误页面来replace它。
我在从NginX托pipeCacti安装时遇到了问题。 我将cacti安装在/ usr / share / cacti下,并在我的默认NginXconfiguration文件中的下面的块中。 location / { root /var/www; index index.html index.htm } location /cacti { root /usr/share/cacti; index index.php index.html index.htm; location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$request_filename; } } 我可以看到的问题是,NginX错误日志充满了“/usr/share/cacti/cacti/index.php”不存在的错误。 现在我只是把额外的目录添加到了cacti中,但是我不知道如何让Nginx在处理页面请求时把URI的'/ cacti /'前缀从URI中“删除”(并将它们传递给PHP5-FPM ) 任何帮助,将不胜感激。
如何防止一个位置被ssl重写匹配? server { listen 80; server_name example.net; location = /feeds/ { break; } rewrite ^ https://$server_name$request_uri? permanent; } server { listen 443; …