我有一个相当大的Drupal网站坐在一个4GB的内存盒子上光油。 我曾经想过(希望?假设?)在Nginx / PHP-FPM之前站在Varnish的位置将会减轻PHP的负担,但是PHP似乎仍然非常活跃,并且我得到了更多的警告:内存已经超过了90%预计会得到。 我从根本上误解了什么Varnish? 我的期望是,它将caching完整的HTTP响应,只是caching它,如果所请求的URL在caching中,就不会向Nginx发送请求,更不用说PHP了。 然而,在和我所知道的有关这个话题的人们交谈的时候,我正在得到一些可能会指出的信息。 任何人都可以填补这些差距? 在Drupal站点中, 绝大多数stream量是匿名的,因此受到光油caching的影响,我们应该期望从Varnish中获得什么? UPDATE 根据请求,这里是我的configuration( default.vcl – 也在一个要点 ): backend default { .host = "127.0.0.1"; .port = "8080"; } acl purge { # Add local/internal server IPs "localhost"; "127.0.0.1"; } sub vcl_recv { if (req.http.User-Agent ~ "MS Search (5|6).0 Robot") { error 403 "Forbidden"; } if (req.http.User-Agent ~ […]
我喜欢在我的Nginx服务器中处理不同的子域,这是我的configuration文件(部分) server { listen 80 default_server; listen 443 default_server ssl; include ssl/mysite.conf; server_name default_server; rewrite ^(.*)$ https://mysite.com$1 permanent; 正如您所看到的,所有对subdomain.mysite.com/query的请求都会在https中redirect到mysite.com/query 。 我只想在子域与string1和string2不同的情况下执行重写。 所以: string1.mysite.com/query —> https://string1.mysite.com/query foo.mysite.com/query —> https://mysite.com/query
我有这样的多个url。 http://domain.com/something/static/variable/ 但现在我想redirect上面的url http://domain.com/anything/static/variable/ 我试过了 location /something{ rewrite ^ http://domain.com/anything$request_uri? permanent; } 但是redirect到 http://domain.com/anything/something/static/variable/ 如何解决这个重写规则?
我应该如何将这个htaccess规则重写为nginx类的规则: RewriteCond%{REQUEST_URI}!^ /?puppy / index.php $ 重写规则。 /puppy/index.php
我只是想知道如果我定义这样的东西: ssl_ciphers 'AES256+EECDH:AES256+EDH:!aNULL'; 在我的虚拟主机configuration在Nginx,它是所有我使用SSL的虚拟主机上活动。 有没有办法为每个虚拟主机单独定义ssl_ciphers和ssl_protocol?
我目前有几个普通的http服务器和一个https服务器。 我想添加具有相同的公共IP的另一个HTTPS服务器。 我有类似的东西 server { listen 443 ssl; server_name sub1.example.com; ssl_certificate sub1.example.com.crt; … } server { listen 443 ssl; server_name sub2.example.org; ssl_certificate sub2.example.org.crt; … } 我遇到的问题是与IE8。 我收到sub1的证书,而不是sub2的。 其他浏览器不存在这个问题。 在阅读http://nginx.org/en/docs/http/configuring_https_servers.html#name_based_https_servers我看到我需要做这样的事情 server { listen 192.168.1.1:443 ssl; server_name sub1.example.com; ssl_certificate sub1.example.com.crt; … } server { listen 192.168.1.2:443 ssl; server_name sub2.example.org; ssl_certificate sub2.example.org.crt; … } 我不确定如何实际设置或分配IP。 我试着把这些IP从上面放到我的nginx conf中,但是没有成功。 重新启动nginx后,我的网站都没有工作。 […]
我正在用以下configuration使用nginx创build虚拟主机: server { listen 7001; server_name example.com; location / { root html; index index.html index.htm; } } 当我尝试访问example.com或exemple.com:7001 ,它不工作,但它正在工作,当我通过localhost:7001访问localhost:7001 ,在我的configuration错误? 编辑1 我在Windows平台上 编辑2 当我尝试通过example.com或example.com:7001访问时,它将访问在线example.com网站,或者在访问example.com:7001时发现网站未find通知:
我在Concrete5上托pipe一个实例,除了使用dynamicpath之外,他们还使用www.mysite.com/index.php/path/to/page奇怪forms的URL。 我主要工作,但我有问题得到Nginx服务请求www.mysite.com/ ,因为它列出的目录,而不是显示index.php 。 www.mysite.com/ – >列出public目录,但应显示index.php www.mysite.com/index.php/path/to/page – >作品! www.mysite.com/some/other/path->作品! 这是我的Nginx conf文件: server { root /srv/www/mysite.com/public_html; server_name mysite.com location / { try_files $uri $uri/ /index.php/$request_uri; autoindex on; # just for debugging… } location ~ \.php($|/) { set $script $uri; if ($uri ~ "^(.+\.php)(/.+)") { set $script $1; } include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$script; fastcgi_intercept_errors […]
nginx版本:nginx / 1.6.2 /usr/logs/nginx-error.log [ uest: "GET /server-status HTTP/1.1", host: "127.0.0.1" 2015/03/14 05:21:24 [error] 23068#0: *8616047 openat() "/var/www/html/server-status" failed (2: No such file or directory), client: 127.0.0.1, server: myname.proj, req ] 我的位置设置为: location /nginx_status { # Enable nginx status page stub_status off; # Disable status page logging in access_log access_log off; # Allow access from […]
我正在使用nginx v1.6.2为基于Web的应用程序提供dynamicnodeJS和静态文件内容。 在一个特定的位置(这恰好是服务于静态PNG文件),我想任何未find的图像请求返回一个特定的占位符图像,“blank.png”。 例如,path为%nginxroot%/html/tiles/sectionals/0/0/0.png确实存在,所以URL http://myhost/tiles/sectionals/0/0/0.png应该返回要求的图像文件。 但是path%nginxroot%/html/tiles/sectionals/0/0/99.png中的文件不存在,所以请求http://myhost/tiles/sectionals/0/0/99.png应该返回文件在%nginxroot%/html/tiles/blank.png 。 这里是我的(为简洁起见)nginx.conf: events { worker_connections 4096; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 20; gzip on; gzip_comp_level 6; gzip_vary on; gzip_min_length 1000; gzip_proxied any; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; gzip_buffers 16 8k; server { listen 80; server_name *.myhost.com; root html; #dynamic content […]