Articles of nginx

在Ubuntu上删除从源代码安装的nginx

我在Ubuntu 10.04服务器上安装了源码(make && make install)的nginx。 现在我想卸载它并从PPA仓库重新安装。 如何卸载从源代码编译的nginx?

Nginx服务器块不能正常工作? – 已经运行其他的虚拟主机,只是这一个不工作

我运行一个Debian 6 LEMP服务器与多个虚拟主机,一切都很好,5个左右的网站。 但我刚刚尝试添加另一个,但由于某种原因,它只是不工作。 我不工作,我的意思是在Chrome中,我得到了“糟糕!Google Chrome无法连接到subdomain.domain.net”错误。 我已将安全域更改为subdomain.example.com ,并且IP被屏蔽。 主机文件(我有多个子域): xxx.xxx.xx.xxx *.example.com *.example 服务器块: server { listen 80; server_name subdomain.example.com; access_log /srv/www/subdomain.example.com/logs/access.log; error_log /srv/www/subdomain.example.com/logs/error.log; root /srv/www/subdomain.example.com/public_html; location / { index index.html index.htm index.php; } location ~ \.php$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } 我在/etc/nginx/sites-enabled/目录下创build了系统链接,并重新启动/重新加载了nginx。 DNS似乎很好: # ping -c 2 subdomain […]

Nginxredirect到(貌似)随机域

我的大脑正在打破这个。 每一个网站都redirect到我的其他网站之一…我会说这是/默认网站,但直到我只是把它作为默认网站,什么都没有改变。 所有的url让我回到www.justaleaf.com (所有网站在过渡之前工作,而且myhashimotos网站正在工作一点点,因为当我禁用所有其他网站时,redirect登陆) 这里是我的configuration(Ubuntu的MySQL的PHP​​的FMP)…我是新来的Nginx,我只是失去了现在: /etc/nginx/nginx.conf user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 768; multi_accept on; use epoll; } http { ## # Basic Settings ## sendfile on; #tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s; # server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; […]

Bootstrap Linux服务器用于URLredirect

我正在设置一个只能通过非常简单的方式redirect请求的nginx / php-fpm服务器。 我打算这样做: 请求应该像http://server-url.com?redirection-url.com那样简单, 将url保存在日志文件中, logging实时分析(piwik.org) 最后通过php-fpm进行redirect。 这将是一个非常快速的服务器,只用于此目的。 问题是:有没有一种方法来计算正确的服务器,我将需要,如果这台服务器接收,比如说,从一天5k到10万次访问? Linux Bootstrap JeOS VPS可以解决这个问题吗? 谢谢。

nginx + php-fpm + apc …压缩?

我有一个VPS运行nginx 1.1.19,php-fpm 5.3.10和APC 3.1.9。 服务器主要运行PHP脚本(vB,SMF,IPB)。我也使用Cloudflare作为CDN。 据我所知,有3个压缩选项,我不确定哪个是相互冗余的,或者它们是什么,哪个服务应该处理。 nginix有gzip,php-fpm有zlib,PHP脚本本身有gzip。 我觉得我已经在很多文档中看到,如果一个web服务器(nginx)正在处理gzip,PHP脚本不应该这样做。 应该在php-fpm zlib与gzip一起启用还是在技术上是一样的东西? 我看到一个源代码说zzib /压缩的gzip / mod_deflate是多余的,不必要地使用CPU周期,但是当zlib和gzip都启用时,我的vB安装似乎运行更顺畅。 有没有人知道这种设置最有效的压缩组合/安排?

Nginx无法启动ssl密钥错误

这里是我在nginx ssl中得到的错误: nginx: [emerg] SSL_CTX_use_PrivateKey_file("/root/cert/l.key") failed (SSL: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib) nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed 到处search,但找不到解决scheme。 问候,

NGINX反向代理:是否有可能代理caching只有404(或其他)的HTML状态码?

有了nginx,最新的,是否有可能代理caching只有特定的HTML状态码响应? 我们使用410个状态代码来进行一些回应。 这些都与我们的数据库进行检查 当所述内容被永远标记为被移除(410)时,发送410状态码。 这个内容永远消失了。 我们只想代理caching这些结果。 这可能吗?

nginx重写竹发票的规则

我只是从Apache的networking服务器迁移到Nginx,我不能让.htaccess转换正常工作。 我试图使用的应用程序是竹发票[ http://bambooinvoice.org/ ],它带有一个默认的.htaccess,看起来像这样: RewriteEngine on RewriteRule ^$ /index.php [L] RewriteCond $1 !^(index\.php|img|css|js|robots\.txt|favicon\.ico|update\.php|install\.php) RewriteRule ^(.*)$ /index.php/$1 [L] 任何人都可以build议如何将这套重写规则翻译成Nginx格式? 我没有任何运气..

使用Nginx限制对MVC应用程序的一个控制器的访问

我有一个MVC应用程序,其中一个控制器只能从几个ips访问(这个控制器是一个oauth令牌callback陷阱 – 对于google / fb api令牌)。 我的conf看起来像这样: geo $oauth { default 0; 87.240.156.0/24 1; 87.240.131.0/24 1; } server { listen 80; server_name some.server.name.tld default_server; root /home/user/path; index index.php; location /oauth { deny all; if ($oauth) { rewrite ^(.*)$ /index.php last; } } location / { if ($request_filename !~ "\.(phtml|html|htm|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|xlsx)$") { rewrite ^(.*)$ /index.php last; break; […]

两个nginx文件可以相互影响吗?

两个nginxconfiguration文件是独立运行的,还是可以互相影响? 例如,我可以在两个同名的configuration文件中命名上游块而不会造成冲突吗?