我们有两个具有独立本地caching的Nginx服务器用于caching图像。 周期性地存在caching大小的非托pipe增长问题。 这个大小可能比nginx.conf max_size大得多。 结果caching占用所有可用磁盘空间。 我想了解这个问题的原因可能是什么。 代理cachingconfiguration( nginx.conf ): proxy_cache_path /opt2/nginx-cache-images1 max_size=150g levels=2:2 keys_zone=images1:1024m inactive=24h; proxy_temp_path /opt2/proxy_temp 1 2; /opt2/nginx-cache-images1大小约为200GB。 configuration网站位置: location / { proxy_set_header Host $host; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Is-Referer-Search-Engine $is_referer_search_engine; proxy_hide_header Set-Cookie; proxy_hide_header Content-Disposition; proxy_pass http://ua-image-proxy; default_type image/jpeg; proxy_cache images1; proxy_cache_key ua$request_uri$is_referer_search_engine; proxy_cache_valid 200 24h; proxy_cache_valid 301 24h; proxy_cache_valid […]
即时尝试提供从亚马逊S3桶静态和媒体文件,但Nginx无法连接到它 这是我得到的错误 <Error> <Code>AccessDenied</Code> <Message> AWS authentication requires a valid Date or x-amz-date header </Message> <RequestId></RequestId> <HostId></HostId> </Error> 和我的Nginxconfiguration server { listen 80; server_name my_elastic_ip; location = /favicon.ico { access_log off; log_not_found off; } location / { try_files $uri @s3; } location @s3 { set $s3_bucket 'my_bucket.s3.amazonaws.com'; set $url_full '$1'; set $aws_access_key 'my_access_key'; set $aws_secret_key […]
有没有办法在Apache中产生相同的Nginx的444错误。 Nginx的 444 – >连接没有响应closures。 我喜欢这个错误,因为如果有人试图CURL,他会得到一个空的响应,但不是在Apache中。
我在Amazon Elastic Beanstalk上使用以下Dockerrun.aws.json文件创build多容器泊坞窗环境: { "AWSEBDockerrunVersion": 2, "containerDefinitions": [ { "name": "web", "memoryReservation": 256, "image": "my/nginx/repo/image", "portMappings": [ { "hostPort": 80, "containerPort": 80 } ], "links": [ "api" ], "essential": true }, { "name": "api", "memoryReservation": 256, "image": "my-api/repo", "essential": true, "portMappings": [ { "hostPort": 3000, "containerPort": 80 } ] } ] } 最终,我希望nginx提供的节点应用程序能够parsing来自链接容器的命名地址的请求,因此在我的web图像(节点应用程序)中,我想向http://api/some/resource发出请求,并让nginxparsing那到api容器。 现在,由于docker为指定的链接添加了api容器的主机条目,所以我希望nginx服务器能够parsing来自主机etc/hosts文件的地址,然而正如我发现的,nginx使用它自己的parsing器。 在研究了这个问题后,我发现在非Elastic […]
我想知道是否有人用nginx的uwsgi来为之前的高负载django网站服务。 如果是的话,他们有什么问题吗?
我们一直在运行nginx – > uWSGI,现在我们正在评估将Varnish作为nginx和uWSGI之间的caching层(类似于http://www.heroku.com/how/architecture )。 但是,nginx只支持HTTP 1.0,所以它将不得不为每个请求创build与Varnish的新连接。 许多人build议在Varnish前面运行nginx,但是使用Cherokee之类的东西不是更有意义,因为它支持后面的HTTP 1.1,所以消除了HTTP连接的开销?
我有PHP 5.3.3和nginx 0.8.47从运行Wordpress博客的源代码编译。 WordPress生成的RSS feed在16k左右被截断(包括头部为16k + 90b)。 通过添加以下内容到我的nginxconfiguration: fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; 问题就消失了。但是,从我在Nginx wiki页面上读到的内容来看,缓冲区只会决定缓冲区何时会溢出到磁盘上。 没有任何信息表明响应可能被截断,因为缓冲区太小。 所以我的问题是,为什么在更改此设置之前,响应被截断? 看来请求不应该被截断,只是由于磁盘缓冲而慢一点。 附加信息: Ubuntu 10.04.2 32位 PAGESIZE 4k
我无法find答案。 安装了PHP5 + NGINX + PHP-FPM并且不能执行php文件,它会得到一个“哎呀!这个链接似乎被打破了。 CHROME错误。 我没有任何有价值的错误日志报告,我有一个index.php根目录,试图创build一个自定义phpinfo.php文件,都没有工作。 我可以加载HTML文件,但不能PHP。 这是我在NGINX的本地站点configuration: server { listen 80; server_name im; access_log /var/www/website/access.log; error_log /var/www/website/error.log; location / { root /var/www/website; index index.html index.htm index.php; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/website$fastcgi_script_name; include /etc/nginx/fastcgi_params; } } 将所有目录的所有权更改为www-data:www-data,在php文件中创build了777,没有任何内容。 重启nginx,FPM,什么都没有。 帮帮我? 🙁
我试图用我的web应用程序创build子域,但是,我没有在nginx的经验,我一直在试图从SFfind一个稳定的解决scheme,但不幸的是我找不到任何好的解决scheme。 我试图做的问题是创build灵活的子域,例如,如果我有像dev.example.com这样的任何子域,它应该沿着/var/www/example.com/www/dev文件目录,和任何types的子域名(WWW除外)将试图find一个目录,如果存在,将其作为根目录。 /var/www/example.com/www/{subdomain} 是当前目录查找,如果它不存在,默认的根将是: /var/www/example.com/www/ 这是我的域sites-enabled了sites-enabledconfiguration文件。 server { server_name example.com www.example.com; root /var/www/example.com/www; index index.php index.htm index.html; error_page 404 /404.html; error_page 500 502 503 504 /50x.html; access_log /var/www/example.com/logs/access.log; error_log /var/www/example.com/logs/errors.log; error_page 404 /index.php; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/example.com/www$fastcgi_script_name; include fastcgi_params; } location /pma { auth_basic "Website development"; auth_basic_user_file /var/www/example.com/www/dev/authfile; […]
我一直在尝试在SSL网站上设置密码保护的目录,如下所示: 在/ etc / nginx的/网站可用/默认 server { listen 443: ssl on; ssl_certificate /usr/certs/server.crt; ssl_certificate_key /usr/certs/server.key; server_name server1.example.com; root /var/www/example.com/htdocs/; index index.html; location /secure/ { auth_basic "Restricted"; auth_basic_user_file /var/www/example.com/.htpasswd; } } 问题是当我尝试访问URL https://server1.example.com/secure/ ,我得到一个“404:找不到”的错误页面。 我的error.log显示以下错误: 011/11/26 03:09:06 [error] 10913#0: *1 no user/password was provided for basic authentication, client: 192.168.0.24, server: server1.example.com, request: "GET /secure/ HTTP/1.1", host: […]