我有一个类似的问题,发布WordPress用户的DreamHost VPS托pipe的内存使用情况 。 这是一个“问题”的原因是,当它最大限度地为我的VPS设置的内存配额,它将开始为'未caching'页面(我猜?)提供503错误页面。 设置更高的配额确实有帮助,但是我认为nginx会比Apache(特别是)和lighttpd节省我一些钱,以及提供更好的性能和更less的内存使用。 我的一个网站只是一个纯HTML的网站,另一个是一个WordPress的网站几乎没有人看/极低的stream量。 我不明白。 我的配额设置为像512MB或640MB的内存,只是为了让它运行得体。 有没有人有任何想法,我可以做什么使nginx运行更有效率,或为什么我有这个问题? 谢谢!
我有一个工作的Apache虚拟主机,如 <VirtualHost localhost:10006> DocumentRoot "/home/pate/***/git/kohana_site/public/site/" </VirtualHost> <VirtualHost *:10006> ServerName api.* DocumentRoot "/home/pate/***/git/kohana_site/public/api/" LogLevel debug </VirtualHost> 如果我指向本地主机:10006我得到我的网站和api.localhost:10006我得到我的API。 然后我有haproxy安装在上面,运行在端口10010和localhost:10010和api.localhost:10010都有预期的行为。 现在我已经在这个configuration的端口80上设置了nginx。 server { listen 10000; server_name api.*; location / { proxy_pass http://legacy_server; } } server { listen 10000 default; server_name _; location /nginx_status { stub_status on; access_log off; } # images are accessed via the CDN over HTTP […]
我使用nginx作为mod_php的Apache前面的反向代理。 我的网站是在https上,它需要将variables$ _SERVER ['HTTPS']设置为'on'来正确组装一些链接。 我的网站是在Drupal上,所以当决定站点是否在https下运行时,不能修复代码并检查其他variables。 有没有办法解决这个问题,只需调整nginx或apacheconfiguration? 我发现其他人也提出了类似的问题,但是我没有find适合我的解决scheme,既没有明确说明我想要的是不可能的。 (例如: HTTPS服务器/ phpvariables不可用 , Nginx:在HTTP上剥离标题,在HTTPS上添加标题 )
背景 我正在build立一个游戏,监视外部行为(微博,FB喜欢等),并定期更新用户更新的信息(每10秒左右通过AJAX)。 所有的用户在一定时间内都会被放入谷歌街景,而且他们需要四处寻找标记。 游戏的思想是标记被隐藏起来,直到用户靠近它们,因此,我们不能将它们存储在JS中(太容易查看源代码)。 所以,每当用户移动时,我们都会发送一个AJAX请求发送经纬度,以便我们可以显示标记,如果他们在正确的区域。 问题 我们有几百人一次玩这个游戏,期待更多。 响应时间约为10 / 20ms,我们正在使用APC,但是当我们打了几百个用户时,服务器的响应时间正在显着减慢(特别是当这些人在街景上跑来跑去时,提出请求或者两个,每一个,每一秒)。 题 我们正在使用4GB内存的LAMP堆栈(我们可以在云端进行更改),但是我想知道是否有更好,更具可扩展性的方式来处理这个问题。 我一直在阅读关于Nginx的许多内容,那么这对于我们的体系结构是否可以同时处理更多的请求? 其他人如何使用LAMP堆栈来处理这种types的轮询?
我是nginx的新手,并试图找出redirect的问题。 我正在尝试将网站从运行Web应用程序的主机redirect到另一个域。 我已经做了这一部分,但我正在掩盖它。 当它redirect时,我不希望用户知道他们已经去了另一个域。 我用我的客户的隐私replace了域名。 但是,他们在test.com上的Linode上运行着一个位于sub.test.com的Web应用程序。 我所希望的是,任何访问test.com的用户都可以redirect到other.com上托pipe的临时站点,但不会暴露域名。 以前,有人指示我怎么做,但很久以前,我不再提供这些信息。 有人可以帮我吗? 我不想公开testing环境的领域。 server { listen 80; server_name www.test.com test.com www.test.net test.net; rewrite ^ http://other.com/sub permanent; #location / { # root /srv/http/www.test.com; # index index.html; #} }
在configurationDrupal和nginx一起工作之后,我想出了一个网站的下面的configuration。 它运行良好,无论是私人和公共文件系统。 然而,因为我对nginx相当陌生,所以我想听听是否有这样的configuration,我应该改变(为 请注意! 我的目标是获得有关通用Drupalconfiguration的反馈。 也就是说,其他正在尝试Drupal + nginx的configuration可以“复制粘贴”来启动和运行。 更新1:我(希望)稍微改进了configuration文件,并且添加了描述性注释来解释文件的各个部分在做什么。 根据input,我也启用了“open_file_cache”指令。 /etc/nginx/nginx.conf(部分) # Cache information about local files. open_file_cache max=1000 inactive=3600s; open_file_cache_errors on; open_file_cache_min_uses 3; open_file_cache_valid 1800s; /etc/nginx/sites-available/example.conf server { listen 80; server_name ~^(www\.)?((example|example-web).+)$; access_log /home/example/www/logs/access.log; error_log /home/example/www/logs/error.log; root /home/example/www/public_html; # Do not log events related to 'favicon.ico'. location = /favicon.ico { log_not_found off; access_log off; […]
即使我从允许的IP连接,下面的代码抛出一个403 location /railo-context/admin { allow 1.2.3.4 #my ip deny all; } 这是整个文件: server { listen 8080; server_name $hostname; # root should be out of location blocks according to Nginx best practices root /opt/railo/tomcat/webapps/$host; # index files index index.htm index.html index.cfm index.cfml; location / { try_files $uri @rewrite; } # This block will catch static file […]
当我做了curl -v http://site-wordpress.com:81我收到了这个结果: * About to connect() to site-wordpress.com port 81 (#0) * Trying ip… connected * Connected to site-wordpress.com (ip) port 81 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-unknown-linux-gnu) libcurl/7.19.7 NSS/3.12.6.2 zlib/1.2.3 libidn/1.18 libssh2/1.2.2 > Host: site-wordpress.com:81 > Accept: */* > < HTTP/1.1 301 Moved Permanently < Server: nginx/1.2.4 < Date: Fri, […]
我试图用nginxbuild立一个file upload服务器。 我的nginxconfiguration: worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; upload_progress proxied 1m; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; client_max_body_size 5000M; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } location /progress { report_uploads proxied; } location /upload { # […]
最近我上传了一些更改到我的服务器,增加了对服务器的AJAX调用的数量。 “牢度”的应用程序减less了很多。 Web服务器是带有php5-fpm模块的nginx 如果我在服务器控制台上运行“top”命令,我看到: 在5到8个php5-fpm进程中,占用CPU使用率的70-80% configuration是:(只是有意义的部分) /etc/nginx/nginx.conf worker_processes 8; events{ worker_connections 1024; multi_accept off; } http{ sendfile on; keepalive_timeout 30; tcp_nodelay off; client_max_body_size 64m; gzip on; } /etc/php5/fpm/pool.d/www.conf pm = dynamic pm.max_children = 10 pm.start_servers = 3 pm.min_spare_servers = 2 pm.max_spare_servers = 4 pm.process_idle_timeout = 5s; pm.max_requests = 400 服务器规格: 24Gb的RAM 至强8内核 你怎么看待这个问题? 它是由服务器configuration不是最佳的? 你build议这个服务器有什么configuration?