我试图设置我的服务器与nginx的uwsgi到Django的堆栈,但我有uwsgi部分的问题。 当我运行uwsgi并传入命令行中的所有参数时,它可以正常工作。 我的uwsgi调用如下所示: uwsgi –socket /tmp/uwsgi.sock –chdir ~/web/test.com –wsgi-file ~/web/test.com/store/wsgi.py –virtualenv ~/web/test.com/testenv –chmod-socket=666 –enable-threads 然后我将这些参数复制到一个如下所示的ini文件中: # django.ini file [uwsgi] master = true socket = /tmp/uwsgi.sock chmod-socket = 666 chdir = /home/ubuntu/web/test.com wsgi_file = /home/ubuntu/web/test.com/store/wsgi.py virtualenv = /home/ubuntu/web/test.com/causumptionenv vacuum = true enable-threads = true 但是,当我运行与django.ini文件uwsgi,我得到这个输出。 [uWSGI] getting INI configuration from django.ini *** Starting uWSGI 1.9.11 (64bit) […]
有一种情况,首先当前的所有请求都应该像当前为特定域名工作一样工作。 例如www.hello.com dynamicDNS将指向相同的静态IP www.hello.com服务器(somedomain.dnsdynamic.com —> XXX.XXX.XXX.XXX) 所有的请求 ,包括GET,POST等,都被代理到另一台带有主机名为finalserver.example.com的服务器 。 (注意这个服务器没有静态IP地址,所以必须使用主机名) 代理服务器只能在www.hello.com服务器获得服务器名称somedomain.dnsdynamic.com的请求时才能使用 已经尝试记住这个答案,但失败了,无论是得到502坏网关或404页面未find
这是我在服务器故障的第一个问题。 searchnetworking时找不到解决scheme。 我正在运行一个运行Nginx的OpenBSD服务器,我没有设置,这是在浏览器中抛出一个502错误的网关错误。 Nginx错误日志显示这个错误: 014/04/29 09:43:49 [error] 5236#0: *263 connect() to unix:/tmp/unicorn.sock failed (61: Connection refused) while connecting to upstream, client: ###.###.###.###, server: , request: "GET / HTTP/1.1", upstream: "http://unix:/tmp/unicorn.sock:/", host: "sub.domain.com" 这里是nginx.conf的内容 user _nginx; worker_processes 2; pid /var/run/nginx.pid; error_log /var/log/httpd.err debug; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format access […]
由于POODLE,我希望放弃对SSLv3的所有支持,但发现仍然有一些人来自旧版浏览器,喜欢Windows XP上的IE浏览器。 如何从nginx中检测这些仅限SSLv3的用户,并将其redirect到一些帮助页面,并提供进一步的说明? 我绝对不需要解决方法来让这些用户使用不安全的浏览器。 如果我可以对所有非SNI浏览器做同样的事情,我会特别高兴的是:SSLv3不带有SNI,所以如果我可以redirect非SNI浏览器,它也将解决SSLv3问题。
我正在使用nginx-1.6.2,2 ,我想返回匹配/browse.php?u=http URL的error 410 ,所以像这样的请求将得到410: 162.218.208.16 – – [21/Nov/2014:12:35:40 -0500] "GET /browse.php?u=http%3A%2F%2Fwww.bing.com%2Fsearch%3Fq%3DBroke%2C%2BUSA%2Bfiletype%3Apdf%26first%3D0%26count%3D20%26format%3Drss&b=156&f=norefer HTTP/1.1" 403 570 "http://ww.thespacesurf.com/browse.php?u=http%3A%2F%2Fwww.bing.com%2Fsearch%3Fq%3DBroke%2C%2BUSA%2Bfiletype%3Apdf%26first%3D0%26count%3D20%26format%3Drss&b=156&f=norefer" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)" 我真的不需要regex ,所以像这样的东西,但它不工作: location = /browse.php?u=http { return 410; } 几天后,我在/var/log/nginx-access.loginput了grep -c $ bzip2 -cd /var/log/nginx-access.log.0.bz2 | grep -c ' 410 ' 5665 $ 这让我感到温暖和模糊)再次感谢!
这让我疯狂! 我想在端口81上使用nginx,在80上使用apache。apache工作正常,但是当我想要启动nginx时,我得到这个错误: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 但是我没有在nginx的端口80上configuration任何站点! server { listen 81 default_server; listen [::]:81 default_server ipv6only=on; server_name _; return 444; } server { listen 81; ## listen for ipv4 server_name domain.com; root /home/domain/public_html/; location / { } . . . } 请注意,我在站点中没有任何其他文件 – 可用的启用站点的文件夹。
我在ubuntu 14.04上使用nginx 版本1.6.2 我试过在引用nginx文档的configuration文件中inputlimit_conn和limit_req 。 Nginx运行良好,没有limit_conn和limit_req选项 。 以下是有日志消息的nginxconfiguration的testing用例。 我不知道我的代码有什么问题。 案例1 – 完整的configuration /etc/nginx/nginx.conf http { … include /etc/nginx/sites-enabled/*; … limit_conn_zone $binary_remote_addr zone=conn_limit_per_ip:10m; limit_req_zone $binary_remote_addr zone=req_limit_per_ip:10m rate=5r/s; … } /etc/nginx/sites-enabled/service.conf server { … location / { limit_conn conn_limit_per_ip 30; limit_req zone=req_limit_per_ip burst=5 nodelay; … } … } log message unknown limit_req_zone "req_limit_per_ip" in /etc/nginx/sites-enabled/service.conf 情况2 – […]
有了这个configuration: upstream some_upstream { server some-elb.us-east-1.elb.amazonaws.com:80; } 如果某些-elb.us-east-1.elb.amazonaws.com映射到2个IP地址,nginx将如何在它们之间分配请求? 循环赛? (对于版本1.1.19,如果行为在某些时候改变了)。 另外,我在这里读到nginx在启动时cachingDNS结果。 如果你使用一个variables,它会刷新它们,但是只有你configuration了一个DNSparsing器。 因此,如果我没有configurationDNSparsing器,那么如果some-elb.us-east-1.elb.amazonaws.com中的某个IP发生更改,会发生什么情况? Nginx会继续发送stream量到它在启动时find的同一组IP吗?
我试图安装几个与nginx无关的软件包(例如htop),使用chef脚本。 但是它失败了,因为它要求更新nginx.conf和nginx / sites-available / default。 我可以select使用厨师。 (我也不想重写,因为我想了解和解决这个问题,而不是从它逃脱) 因此,我尝试通过运行命令sudo apt-get install htop尝试安装htop,并且我得到了以下输出。 ubuntu@ip-10-150-4-249:~⟫ sudo apt-get install htop Reading package lists… Done Building dependency tree Reading state information… Done The following NEW packages will be installed: htop 0 upgraded, 1 newly installed, 0 to remove and 160 not upgraded. 3 not fully installed or removed. Need […]
我试图激活gzip压缩,我已经设置了选项gzip_vary; 包含Vary:Accept-Encoding标头。 问题是,我的应用程序已经在设置Vary:标题。 所以现在响应有两个Vary:头文件,一个来自我的应用程序,一个来自nginx。 HTTP/1.1 200 OK Server: nginx Date: Sat, 17 Dec 2016 13:28:38 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive Vary: Accept-Encoding Last-Modified: Sat, 17 Dec 2016 13:28:38 GMT Cache-Control: no-cache, no-store, must-revalidate, max-age=0 Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Vary: User-Agent Content-Encoding: gzip 但是我想应该是这样的: Vary: Accept-Encoding, User Agent 我怎样才能做到这一点?