我有一个服务器与Nginx下运行良好(WordPress博客)的服务器域。 现在我想设置一个phplist服务器,并find它在一个子域下,但虽然我认为我configuration了子域没有问题,每次我尝试加载子域请求直接到我的域之一。 这是我的域的Nginxconfiguration文件(我已经replace了域名): server { listen 80; server_name mydomain.com www.mydomain.com; # error_log /var/www/mydomain/mydomain_error.log; root /var/www/mydomain/; location ~* ^.+.(bz2|jpe?g|gif|gz|png|ico|css|zip|rar|doc|xls|exe|pdf|ppt|txt|tar|tgz|mid|midi|mp3|wav|bmp|rtf\ |js|swf|avi|m2t|mkv)$ { access_log off; expires 30d; root /var/www/mydomain/; } location / { index index.php; client_max_body_size 3M; try_files $uri $uri/ /index.php?q=$uri&$args; # if the requested file exists, return it immediately if (-f $request_filename) { break; } #if ($http_user_agent […]
我有一个域http和https监听。 我想redirect所有stream量到https除了两个特定的位置。 它的作品,但只为mydomain.com,而不是www.mydomain.com。 这里的configuration: upstream mydomain_rails { server unix:/home/deploy/mydomain/shared/pids/unicorn.sock; } # blog.mydomain.com server { listen 80; server_name blog.mydomain.com; rewrite ^ http://www.mydomain.com/de/blog permanent; } # blog.mydomain.com.br server { listen 80; server_name blog.mydomain.com.br; rewrite ^ http://www.mydomain.com/br/blog permanent; } # www.mydomain.de server { listen 80; server_name mydomain.de www.mydomain.de; rewrite ^ https://www.mydomain.com/de permanent; } # www.mydomain.com.br server { listen […]
我有一些麻烦设置nginx服务我的分期网站。 我所做的是更改server_name,但由于某些原因,它不工作。 urlscheme是“domain.foo”是生产,“staging.domain.foo”正在升级,“foobar.domain.foo”是一个Web服务,“foobar.staging.domain.foo”是相同的升级版本webserver,“. domain.foo”被路由到一些s3的静态HTML,“. staging.domain.foo”被路由到另一个桶中的s3静态HTML。 所有生产url都能正常工作,并且configuration正确,所有的分段URL都不起作用。 这是我的conf文件。 你会看到一些重复,我会很乐意接受任何更正/优化,我是一个编码器和configuration服务器绝对不是我的事情(但我渴望学习和改善…)。 server { listen 80; ## listen for ipv4 server_name "domain.foo" "www.domain.foo" default_server; access_log /var/log/nginx/access.log; client_max_body_size 5M; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; location ~* \.(jpg|jpeg|gif|png|ico|css|bmp|js|html)$ { access_log off; expires max; root /home/foo/Foo/current/public; break; } if ($host ~ 'www.domain.foo') { […]
我有一个4GB的内核VPS与4GB RAM。 它使用nginx / 0.7.65,PHP 5.3.2和MySQL运行Ubuntu 10.04。 我使用php5-fpm与nginx进行通信。 我也有php5-apc与phpcaching恭维。 该系统运行四个网站,每天显示大约250万页面浏览量。 问题简介 – 加载页面时,站点将间歇性地显示错误404。 它可能发生在每个页面上,我可以坐下来一遍又一遍地刷新,平均每七到十次发生一次。 我试过了 – 更新Ubuntu和Nginx,使用PHP和Nginxconfiguration。 这个问题已经被复制到Ubuntu 11.10和nginx / 1.0.5。 值得注意的日志 – Nginx的error.log和access.log没有显示任何不寻常的事情,但是在404发布时做报告。 php5-fpm.log显示: Nov 20 21:47:45.640003 [ERROR] [pool www] unable to retrieve process activity of one or more child(ren). Will try again later. 但我不相信这是与这个问题有关,正如我在以前的设置中看到的那样。 configuration(指向图像的链接以节省空间) – * APC设置,注意碎片:0%,caching完整计数为0. http://i.imgur.com/fV8hU.png * nginx.conf user www-data; […]
我试图设置Nginx使用proxy_pass转发请求到几个后端服务。 缺less结尾斜杠的页面上的链接确实在前面有https:// ,但是被redirect到一个带有斜杠的http请求 – 这些连接以拒绝连接结束 – 我只希望通过https访问这些服务。 所以如果一个链接太https://example.com/internal/errorlogs 在浏览器中加载时https://example.com/internal/errorlogs给出Error Code 10061: Connection refused (redirect到http://example.com/internal/errorlogs/ ) 如果我手动追加testing斜杠https://example.com/internal/errorlogs/加载 我已经尝试了不同的尾随正斜杠附加到proxypath和proxy.conf中的位置无效,也添加了server_name_in_redirect off; 这发生在nginx下的多个应用程序,并在Apache反向代理工作 configuration文件; proxy.conf location /internal { proxy_pass http://localhost:8081/internal; include proxy.inc; } …. more entries …. /主启用的站点 – server { listen 443; server_name example.com; server_name_in_redirect off; include proxy.conf; ssl on; } proxy.inc proxy_connect_timeout 59s; proxy_send_timeout 600; proxy_read_timeout 600; […]
server { listen 81; server_name example.com localhost direct1.example.com www.example.com admin.example.com forum.example.com; location /media/ { root /var/www/vhosts/example.com/html; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location / { proxy_set_header Host $host; proxy_set_header Connection Close; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; root /var/www/vhosts/example.com/html; proxy_pass http://127.0.0.1:80; } } 这是我在nginx / defaults.conf中的。 该服务器目前使用Apache罚款,和Plesk,似乎自行pipe理虚拟主机(以某种方式)。 […]
我正在使用以下脚本来启动/停止nginx: #! /bin/sh ### BEGIN INIT INFO # Provides: nginx # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the nginx web server # Description: starts nginx using start-stop-daemon ### END INIT INFO PATH=/opt/nginx/sbin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/opt/nginx/sbin/nginx NAME=nginx DESC=nginx test -x $DAEMON || exit 0 # […]
我有一个作为代理运行的nginx服务器。 它的页面被configuration为被caching并被压缩。 但是然后它每隔一段时间就会把页面作为.gz文件显示为一个文件来下载。 curl -I命中返回二进制数据。 curl -I www.site.com/cs 但是,当我删除caching文件夹一切开始工作正常。 sudo rm -r /tmp/nginx/cscache/ 什么可能是错的 ? 有人可以帮忙吗? 这是configuration location = /cs { proxy_pass http://localhost:82; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_ignore_headers Set-Cookie; proxy_ignore_headers Cache-Control; proxy_ignore_headers Expires; proxy_ignore_headers X-Accel-Expires; add_header X-Cache-Status $upstream_cache_status; proxy_cache cscache; proxy_cache_bypass $http_cs; proxy_cache_key $request_uri; proxy_cache_valid 200 302 1d; proxy_cache_valid 404 1m; proxy_cache_use_stale error […]
HY, 我有正确的安装nginx我的网站,一切工作正常,非常快:) 但是我的访问日志中有这样的错误: IP – [30 / Dec / 2011:11:06:00 +0000] – “ – ”400 0“ – ”“ – ” IP – [30 / Dec / 2011:11:06:10 +0000] – “ – ”400 0“ – ”“ – ” IP – [30 / Dec / 2011:11:06:20 +0000] – “ – ”400 0“ – ”“ – ” IP […]
我在这里寻求一些帮助,我已经花了不less时间在这个网站searchpost,也在谷歌试图看看问题可能是什么,并试图解决我的问题没有太大的成功。 我有以下设置。 我们正在与Linode.com托pipe。 (1) – 一个负载均衡器循环,最less连接到以下两个节点(2) – 每个运行Nginx + php-fpm + APC的2GB节点,并通过本地连接到专用机器上运行的另一个mySQL实例IP地址。 每个节点都有(4)专用内核。 我在每个节点上运行一个worpdess站点,基本上每个节点都运行相同的wordpress PHP代码的完全相同的副本。 一切正常运行,但CPU的负载非常高,我们正在平均节点上的以下负载: 节点1:平均负载:4.11 3.84 3.95节点2:负载平均:4.20 3.94 4.95 为什么核心尖刺和负载。 整个网站每天在(2)个节点上获得大约210万个请求。 这是nginxconfiguration还是php-fpm问题,还是只需要添加一个或两个以上的节点? 预先感谢您的帮助。 戴夫 我的nginx.conf [ddavtian@mobilefood-1 nginx]$ more nginx.conf ####################################################################### # # This is the main Nginx configuration file. # # More information about the configuration options is available on # * the […]