最近我有一个新的网站开始完全取代以前的网站。 我们有前面的cloudflare,并将主机名称切换到新的站点IP。 瞬间我们看到负载超过了200+,并且有大约25Mbps的404 HTTP响应(我猜CPU核心最大时不会更高)。 从我可以看到有很多点击每秒rss.xml(不再存在于新的网站,而它在旧的)。 这个请求反过来让WordPress启动WP负载序列,它加载了一些插件(带有可疑的非高性能代码),每秒请求的数量很大,导致非常高的服务器负载。 今后要防止这种情况: 一个人可以通过nginx限制对这个RSSurl(或任何其他url)的请求吗? 有没有办法阻止WordPress服务器closures,如果没有find文件快速退出,而不是加载非caching页面(和所有后续的插件),以便它可以呈现404页面?
我试图开始使用Homestead为我的非Laravel项目( 遗产 ),我设法通过克隆laravel/homestead 2.2.1 (使用PHP 5.6.15)成功地安装框0.3.3 。 现在我的问题是由于.htaccessconfiguration。 我使用的是Apache,但是在Nginx(Homestead)中No input file specified 。 我使用的.htaccess如下所示。 目标是 允许浏览器加载/下载一些特定的扩展名 禁止任何加载/下载特定文件夹( config和email ) redirect到index.php RewriteEngine on RewriteRule !\.(ini|js|ico|gif|jpg|png|css|html|swf|flv|xml|csv)|^[config/*|email/*]$ index.php 我尝试使用在线工具来转换,像Anilcetin和winginx没有运气。 在我的服务器中,我假设加载URL /user/panel和/user/manager/shop , index.php文件知道如何从URL读取并加载正确的页面。
我有25个主机与WordPress网站的虚拟服务器。 用户需要能够访问他们的网站通过〜用户名从主域如下所示: http : //subdomain.example.com/~username/工作正常,但如果他们尝试通过添加wp-admin访问pipe理区域:〜username / wp-admin他们被redirect到: http : //subdomain.example.com/wp-admin/ 任何机会有人知道如何设置子子域,如username.subdomain.example.com? 因为一些服务不工作,如果你有〜在站点名称:( 这就是我现在在默认的nginx主机上所做的: set $root_dir /home/defaulthost/public_html/; rewrite ^(/~[^/]+)$ $1/ redirect; rewrite ^/~(?<user>[^/]+)(.+) $2; if ($user) { set $root_dir /home/$user/public_html; } root $root_dir;
我需要Nginx Web服务器连接到侦听端口443的https服务器。直接通过Nginx服务器计算机无法访问https服务器,并且到达nginx服务器需要设置http_proxy和https:proxy参数的https:proxy 。 我们之前使用的是Apache,并使用ProxyRemote * http://10.23.45.32:3128参数来实现,它允许apache服务器通过代理服务器连接到远程https服务器。 我们正在从apache转移到Nginx,需要知道如何添加代理规则,以便Nginx服务器可以将请求传递给https服务器。 我为Nginx设置了以下configuration。 server { listen 80; server_name localhost; access_log /var/log/nginx/localhost.access.log; location / { proxy_pass http://localhost:9000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } #below path is working fine location /cities.json { proxy_pass http://hostname.net:8080/cities.json; } #below rule is working fine location /states/ { proxy_pass […]
我尝试安装Rails + Passenger + Nginx + Modules,但安装程序开始编译Nginx时出现错误: sh ./configure –prefix='/opt/nginx' –with-http_ssl_module –with-http_gzip_static_module –with-http_stub_status_module –with-cc-opt=-Wno-error –with-ld-opt='' –with-pcre='/tmp/passenger.1x6s546/pcre-8.34' –add-module='/usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.24/src/nginx_module' –with-http_geoip_module –with-http_limit_conn_module –http_limit_req_module –with-http_log_module 而乘客安装后,它开始与Nginx它会引发错误: error: ./configure: error: invalid option "–with-http_limit_conn_module" 什么可能是一个原因?
我有一个主摄取服务器和多个边缘节点,每个从摄取服务器拉。 但现在我有10000个摄像头推送stream来掌握摄取服务器,我怕它无法处理它。 所以我打算添加更多的主摄取服务器(与LoadBalancer LVS来处理哪些主摄取服务器,这些摄像机将推送stream)。 但是,如果有多个主服务器接收服务器的边缘节点如何将所有这些数据stream拉出来。 我也像这样在边缘节点testing拉选项 application live { notify_method get; idle_streams off; pull rtmp://master_server_1/live live=1; pull rtmp://master_server_2/live live=1; } 但是它只从master_server_1中提取stream。 有什么build议? 谢谢 顺便说一句,我想我不需要更多的主服务器,只是升级带宽。 这样对吗 ? 谢谢
一旦Nginx检测到错误,有没有办法从php访问服务器响应,并将服务器响应邮寄给pipe理员,同时向访问者显示自定义错误页面? 目前我能够委托错误页面到PHP,从那里我可以发送一封邮件给pipe理员与我从nginx获得的有关请求的信息,但它检测到所有的GET请求,丢失所有的POST信息,我发现没办法访问实际的响应,所以我可以邮件给pipe理员,所以基本上我发送了一个关于错误的非常不完整的报告。 有没有办法不松动POST信息,一旦请求委托给PHP,从服务器读取响应? 有没有其他的方式来邮件的错误页面,同时显示自定义的错误页面? 这是我当前的nginx设置(连接到error_page子句的GET参数是我发现将一些信息传递给PHP的唯一方法,以便生成错误的后端服务器): location / { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_connect_timeout 4s; proxy_pass $scheme://hsbservers_$scheme; proxy_next_upstream error timeout invalid_header http_502 http_504; proxy_intercept_errors on; server_tokens off; } error_page 500 503 502 504 /error.php?err=$status&svr=$upstream_addr&uperr=$upstream_status&sT=$upstream_response_time&pT=$request_time; location ~ error\.php$ { try_files $uri /index.php; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } 这是我从PHP发送的一个POST请求产生错误的电子邮件的例子: _SERVER Array ( […]
我一直在试图设置2个不同的caching时间。 我需要一个单一的请求微caching。 而所有其他的请求应该被caching更长的时间。 所有的请求必须去位置块,以便请求被传递给PHP。 我收到运行nginx的错误-t: nginx:[emerg]无效的时间值“$ cache_time” 这里是我的nginx conf服务器块的一部分: set $cache_time 5m; if ($request_uri ~ "myurl/\d*"){ set $cache_time 2s; } location ~ \.php { fastcgi_cache MYCACHE; fastcgi_cache_valid 200 $cache_time; fastcgi_no_cache 0; fastcgi_pass 127.0.0.1:9000; fastcgi_index /index.php; include /etc/nginx/fastcgi_params; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } 为什么说无效的$ cache_time? 也尝试过“2”。 我不允许从variables中设置它吗? 任何解决方法?
我在一个512Mb digitalocean VPS上主办一个WordPress站点。 一切都很好,清漆是一个完美的命中率。 login用户绕过。 我唯一注意到的是php5-fpm每次访问都会触发。 我怎样才能跟踪什么是pipe理绕过caching,并传递到后端。 系统负载非常好,清漆是这样一个小的VPS惊人的,但我的目标是找出为什么php5-fpm发射时,我不认为这是必要的。 谢谢
我最近注意到,我的一个运行nginx代理的站点可以通过一堆随机域访问。 其中一些是由http://unblocksit.es等网站生成的代理。 这些大多是无害的,但是有代理注入添加和其他看起来像他们旨在拦截用户凭据。 我知道我可以阻止他们的IP,但它是不断的比赛,我将永远是一个必须赶上。 有没有其他机制可以用来防止通过反向代理访问nginx?