Articles of nginx

ssl客户端证书validation在nginx中失败

我正在尝试在nginx中设置SSL客户端身份validation。 我创build了一个自签名的根CA. 使用这个,我创build了一个子CA。 我使用这个子CA为客户端创build一个证书。 我将子CA和根CA连接成一个新文件。 我validation了客户端证书如下: $ openssl verify -purpose sslclient -CAfile auth-root.crt testcert.crt testcert.crt: OK auth-root.crt是级联的子级和根级CA; testcert.crt是客户端证书。 我使用ssl_client_certificate将nginx指向auth- ssl_client_certificate 。 当我使用testcert.crt证书发出HTTP请求时,nginx失败。 我打开debugging日志,可以看到以下内容: 2012/06/21 22:58:47 [debug] 8901#0: *2 verify:0, error:2, depth:1, subject:"/C=US/ST=Florida/L=Tampa/O=Test org/OU=Test OU/CN=AuthCerts TestCA",issuer: "/C=US/ST=Florida/L=tampa/O=Test org/OU=Test OU/CN=Root TestCA" 2012/06/21 22:58:47 [debug] 8901#0: *2 verify:0, error:27, depth:1, subject:"/C=US/ST=Florida/L=Tampa/O=Test org/OU=Test OU/CN=AuthCerts TestCA",issuer: "/C=US/ST=Florida/L=tampa/O=Test org/OU=Test OU/CN=Root TestCA" […]

Nginx重复默认服务器错误

我有2个文件。 默认值: /etc/nginx/sites-enabled/default server { listen 80; ## listen for ipv4 listen [::]:80 default ipv6only=on; ## listen for ipv6 << LINE 10 然后我有一个自定义文件: /etc/nginx/nginx.conf http { server { server_name mydomain; listen 3000; root /projects/myproject/public; } } 当我尝试重新启动服务时收到此错误: the duplicate default server in /etc/nginx/sites-enabled/default:10 configuration file /etc/nginx/nginx.conf test failed 我对nginx的经验很less,希望有人能指出我可能出错的地方?

nginx作为代理使用特定的源IP

我正在使用nginx提供静态文件和代理其他请求到一些Tomcat实例。 问题是我不知道如何selectnginx使用哪个IP地址连接到Tomcat。 每个Tomcat实例只接受来自特定IP地址的HTTP连接。 我的服务器有所有这些IP。 我只是不能selectnginx将使用哪一个。 这是我的configuration文件: proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; location /integracao/ { proxy_pass http://XXXX:9080/integracao/; } location /solr/ { proxy_pass http://YYYY:8080/solr/; } 我的服务器有一个接口,带有两个IP地址:A和B.我需要使用IP A连接到第一个Tomcat和IP B以连接到Solr。 有谁知道如何做到这一点?

在可靠部署期间validationnginx.conf

我有一个单一的Ansibleconfiguration服务器运行一些网站。 我的Ansible任务大致如下: – name: site nginx config template: src="nginx-site.conf.j2" dest=/etc/nginx/conf.d/{{item.name}}.conf owner=root group=root mode=0444 with_items: sites notify: restart nginx – name: nginx conf template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf owner=root group=root mode=0444 notify: restart nginx 我想使用Ansible模板模块的validate参数来调用nginx -t ,并确保我的新configuration在语法上是有效的。 它适用于主要的nginx.conf: template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf owner=root group=root mode=0444 validate="/usr/sbin/nginx -c %s -t" 但它似乎没有拿起对特定于站点的configuration文件的更改。 validate网站特定的模板不起作用,因为他们需要包装在一个http指令是有效的。 我能做些什么来检查这些特定于站点的文件的有效性?

从Apache迁移到nginx的经验?

我想获得一些关于从Apache到nginx的迁移的反馈。 我的目标是减lessWeb服务器的内存占用。 目前,我在Apache上使用以下modules.features: 多个虚拟主机 服务器端包含 快速的CGI 请分享您的经验:迁移期间的问题,迁移后的收益(值得吗?),nginx的有用模块等。

Nginx反向caching301redirect(永久)

是否有可能让Nginxcaching所有301redirectproxy_pass请求? 例如: 请求#1:客户端A请求/某些/path – >发送到proxy_pass – >导致301redirect到/some/other/path – > nginxcaching这个响应,因为它是301redirect。 请求#2:客户端B请求/ some / path – > nginx返回caching301redirect到/some/other/path 。

一些nginx反向代理configuration每天停止工作一次

我有一个nginx反向代理服务器,它将来自外部亚马逊ELB的请求代理到内部ELB。 我有6个后端实例处理请求。 站点启用configuration看起来像这样,但有不同的端口号和proxy_pass。 其他一切都是一样的: server { listen 3000; location / { proxy_pass http://internal-prod732r8-PrivateE-1GJ070M0745TT-348518554.eu-west-1.elb.amazonaws.com:3000; include /etc/nginx/proxy.conf; } } 每24小时一次configuration停止工作。 所有其他代理工作正常。 如果我重新启动nginx,所有configuration再次工作。 error.log中没有任何内容,访问日志,系统日志或dmesg中没有什么奇怪的。 这个东西是已知的吗? 我的代理configuration有问题吗? 有没有其他的日志我可以看?

部署CherryPy应用程序:独立,WSGI服务器还是NGinx?

我打算使用单个VPS将多个低stream量CherryPy应用程序部署为子目录; 例如: example.com/app1等 在研究WSGI部署之后,看起来部署应用程序的首选方法是在反向代理设置中使用WSGI服务器(Gunicorn,uWSGI等)和NGinx。 看起来使用两个networking服务器似乎有点过分 – 尤其是因为我的CherryPy应用程序本身就是一个networking服务器 – 但我不想随意地将这个想法解雇。 我当然不是专家,所以我想讨论一下。 我看到三个选项: 自己部署CherryPy。 部署在Gunicorn或其他WSGI服务器下。 部署在WSGI服务器之下,并反向代理到NGinx,这似乎是每个人的解决scheme。 我的问题: 我到处看到这种模式的主要原因是什么? NGinx是不是很好? 对于低stream量的应用程序,本地CherryPy服务器是否足够好,还是我应该不尝试? 任何和所有的build议表示赞赏,谢谢。

如何在Debian 7上将nginx从1.2升级到1.6

我浏览了整个网页,但找不到任何东西! 我修改sources.list但服务器是掖到Nginx 1.2,我不知道该怎么做,请帮助

根据IP地址/子网使用Nginx来服务不同的页面

由于可怕的原因进入…我使用Nginx作为networking服务器,并希望它为内部用户(10.0.0.0/16说)和另一个页面上的外部用户在任何其他IP地址服务一页。 例如: IP为10.0.0.34的“内部”PC转到company.com/page.html获取页面internal.html IP地址为8.8.8.8的“外部”PC转到company.com/page.html获取页面external.html