我使用apt-get安装了最新版本的nginx(1.0.15): http : //nginx.org/en/download.html 。 出于某种原因,当我重新启动服务器时,nginx没有自动启动,因为我相信它应该。 /etc/init.d/nginx存在,所以我可以手动启动/停止/重新启动,但是为什么不自动启动? 如果通过apt-get安装的话,我觉得它应该是开箱即用的。 谢谢。 编辑:在查看各种日志后,我发现nginx启动时没有启动,因为我有一个没有证书的SSL服务器(还没有添加证书,因为我还没有迁移域)。 注释掉ssl服务器似乎解决了这个问题。 我认为,当我准备添加领域的证书时,问题将不会再次出现 – 这是希望:)。 顺便说一下,我也遇到了上述变化似乎已经解决的问题。 我有选项-Indexes在Apache中设置,以防止目录浏览,对于大多数目录path,我会从Apache获得“Forbidden”消息。 但是,对于某些人来说,如果我省略了path中的尾部斜杠,服务器将不会响应Forbidden消息或任何消息。 我以为我必须有一些设置在nginx或apache2是造成这一点,但无法确定一个。 现在问题已经随着上述变化而消失了。 无法解释它。
我有nginx设置,但是我需要解决一个问题,有人input“/ Home”来: 把它重写成小写的“/ home”(对所有文件和目录,不只是在家里),而是find大写(如果有的话)文件。 还是需要添加另一个使用不区分大小写的字符“〜*”的位置? 实际的目录和文件布局确实包含混合的大写和小写字符。 为了简单起见,我想保留这个,例如/ Home和/ About是实际的目录,但是对于SEO,我想永久redirect到小写/ home,但是find实际的/ Home目录。 我不确定这是否可以通过重写规则来完成,或者是否在“位置/ {}”或某个组合上不区分大小写。 location / { try_files $uri $uri/ /Home; } 注意:我不是在寻找属于Nginx陷阱的答案, 包括邪恶的Ifs 。
我想知道是否将cPanel / WHM作为控制面板使用Nginx作为web服务器(在端口80上)和Apache作为反向代理(在端口8080上)是一个好主意? 我也安装了Nginx Admin,所以NginX的configuration由WHMpipe理。 我问的原因是因为我遇到了一篇文章( http://kbeezie.com/view/apache-with-nginx/ ),它解释了如何将Apache设置为反向代理,但是它声明 如果您使用的是基于控制面板的主机,例如cpanel / whm,则不build议使用此方法。 在这种情况下,大多数服务器configuration会自动处理,而手动更改可能会导致问题(另外在大多数情况下,控制面板制造商或托pipe服务提供商不会获得支持)。 任何人有任何过去的经验,可以说,如果它的好/坏主意?
我一直在寻找支持SSL的服务器集群的不同设置,我想用你的标准来衡量我的想法。 要求: 群集中的所有服务器应该位于相同的完整域名下。 (http和https) 路由到子系统是在HA代理中进行URI匹配。 所有URI都支持SSL支持。 希望: 集中路由规则 —<—-http—–<– | | Inet –>HA–+—https—>NGInx_SSL_1..N | | +—http—> Apache_1..M | +—http—> NodeJS 想法:configurationHA将所有SSLstream量(mode = tcp,algorithm = Source)路由到一个将httpsstream量转换为http的NGInx集群。 将来自NGInx的httpstream量重新传递给HA,以实现基于HAconfiguration的负载平衡。 我的问题很简单:这是根据以上要求进行configuration的最佳方式吗?
背景:3台服务器,1台负载均衡器和2台PHP应用服务器。 我需要在2台应用程序服务器上安装nginx吗? 或者,我可以直接从负载平衡器传递到在应用程序服务器上运行的PHP-FPM吗?
我有一个运行nginx和Plack / Starman的网站作为上游。 简单的configuration看起来像: 上游findmjob { server unix:/tmp/findmjob.sock; } 服务器{ 听80; server_name findmjob.com www.findmjob.com fb.findmjob.com; access_log /findmjob.com/log/access.log; error_log /findmjob.com/log/error.log info; root /findmjob.com/static; 位置 / { try_files $ uri @proxy; access_logclosures; 到期最大; } 位置@proxy { proxy_set_header主机$ http_host; proxy_set_header X-Forwarded-Host $ http_host; proxy_set_header X-Real-IP $ remote_addr; proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_pass http:// findmjob; } } 我有一些Perl代码返回一个redirect。 这意味着它可以在perl […]
我目前正试图让nginx与使用cgi的cgit一起工作。 我知道nginx不直接支持cgi,但似乎可以通过FastCGIWrap间接支持它。 上面的链接是非常明显的,但我在编译程序时遇到问题。 到目前为止我所做的是: 安装了libfcgi-2.4.0 cd fcgiwrap && autoconf -i 当我运行./configure我得到这个输出 checking for gcc… gcc checking for C compiler default output file name… a.out checking whether the C compiler works… yes checking whether we are cross compiling… no checking for suffix of executables… checking for suffix of object files… o checking whether we are using […]
目前我们正在将所有的服务从apache2迁移到nginx,但是目前还停留在特定的重写规则中。 apache中的规则是检查caching的图像/缩略图是否存在,如果存在,则直接发送输出。 否则会将请求重写到image processing器。 # if cached version exists, output directly RewriteCond %{QUERY_STRING} ^(Guest|Member|avatar|tagged|thumb)$ RewriteCond %{DOCUMENT_ROOT}/cache/$1/%{QUERY_STRING}.jpg -f RewriteRule (.*)\.jpg$ /cache/$1/%{QUERY_STRING}.jpg [L] # otherwise redirect all jpg-image-requests to processing # script if they are not in cache dir RewriteCond %{REQUEST_URI} !^/cache RewriteRule \.jpg$ /image_processing.php [QSA,L] 我们尝试了几个try_files方法,但是到目前为止我们失败了。 有人可以帮助将这个重写规则移植到Nginx吗? 非常感谢你!
我有一个nginx.conf ,看起来像这样: server { server_name subdomain.example.com; listen 443 ssl; ssl_certificate /srv/ssl/something.crt; ssl_certificate_key /srv/ssl/something.key; access_log /var/log/something-nginx-access.log; error_log /var/log/something-nginx-error.log; location /private { try_files $uri @yourapplication; } location @yourapplication { include uwsgi_params; uwsgi_pass 127.0.0.1:3131; auth_basic "Restricted"; auth_basic_user_file /home/ubuntu/something.htpassword; } location / { try_files $uri @yourapplication; } location @yourapplication { include uwsgi_params; uwsgi_pass 127.0.0.1:3131; } keepalive_timeout 70; } server […]
我们有一个embedded式http服务器的C / C ++应用程序。 我们的http服务器非常原生,不支持ssl或保持连接。 它侦听端口5555和服务器静态页面。 在服务页面之前,它会回应一下。 它还支持使用Etags进行cachingvalidation。 根据If-None-Match值,它发送304 Not Modifed 。 如果我们将浏览器redirect到some-ip:5555它工作的很好。 示例请求和响应标题如下 Response Headers Cache-Control max-age=3600, must-revalidate Content-Encoding gzip Expires Wed, 15 May 2013 07:18:08 GMT Request Headers Accept */* Accept-Encoding gzip, deflate Accept-Language en-us,en;q=0.5 Cache-Control max-age=0 Connection keep-alive Host 127.0.0.1:5555 If-Modified-Since Tue, 08 May 2012 08:48:53 GMT If-None-Match "1336466933_85925" Referer http://127.0.0.1:5555/mlogin.html User-Agent […]