所以我已经使用NGIX与docker和许多应用程序django与UWSGI服务器Linux。 所以我需要创build一个在Docker容器内执行的工作。 这个工作将做一个应用程序Django的一些url的请求。 但是,当我试图提出请求时,我没有收到任何回应。 命令 wget localhost:3031 –bind-address=127.0.0.1 响应: –2015-09-23 14:20:15– http://localhost:3031/ Resolving localhost (localhost)… ::1, 127.0.0.1 Connecting to localhost (localhost)|::1|:3031… failed: Invalid argument. Connecting to localhost (localhost)|127.0.0.1|:3031… connected. HTTP request sent, awaiting response… No data received. Retrying. –2015-09-23 14:20:16– (try: 2) http://localhost:3031/ Connecting to localhost (localhost)|127.0.0.1|:3031… connected. HTTP request sent, awaiting response… No data […]
我看着我的nginx error.log,看到它被这些错误填满: FastCGI sent in stderr: "PHP message:" while reading response header from upstream, client: …, server: …, request: "GET /forum HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "…", referrer: "…" 正如你所看到的,没有错误引发的信息。 那里没有消息的原因是什么? 先谢谢你。
我有一个与nginx,fastcgi部署的opencart应用程序。 我使用RDS作为Mysql服务器。 最近,我一直在我的日志中有这个错误,我运行负载testing围攻400并发用户。我得到这个错误 FastCGI sent in stderr: "PHP message: PHP Warning: mysqli::mysqli 同时使用apache作为服务器运行相同的负载testing。testing产生积极的结果 这些是用nginx围攻的结果 Transactions: 3246 hits Availability: 77.80 % Elapsed time: 146.43 secs Data transferred: 35.27 MB Response time: 6.86 secs Transaction rate: 22.17 trans/sec Throughput: 0.24 MB/sec Concurrency: 152.01 Successful transactions: 1049 Failed transactions: 926 Longest transaction: 36.83 Shortest transaction: 0.65 并与Apache Transactions: […]
我在.conf中使用nginx的第三方Heroku buildpack : http { … server { server_name _; … } include config/nginx-local*.conf } 显然最好是在包含文件中进行自己的configuration,而不是编辑这个configuration文件。 我想在/assets上提供静态文件。 作为nginx新手,我天真地尝试过: server { server_name static; location /assets { root <disk location> } } 但后来我发现 server_name应该是服务器的位置,例如www.example.org 。 由于我不想使用子域名,所以添加一个新的server块似乎是不合适的。 那么有没有办法引用现有的 server块,并从顶级http上下文中添加一个location块?
在我的组织中,我们正在迁移某个Web +邮件设置,我认为也许nginx可以适合做我想做的事,但是我不能完全理解官方文档 。 我有一台Web应用程序(内部)在机器A,有一组用户。 机器A能够以*@example.net发送邮件。 我想允许一些用户发送邮件为:[email protected],而不是[email protected](某些用户共享一些组,并且用户有几个允许的组)。 我可以设置nginx根据某个URL来validation用户,并根据MAIL FROM字段允许或禁止某个用户吗? 如果我可以像最后一个例子一样接收请求(相同的链接): GET /auth HTTP/1.0 Host: localhost Auth-Method: none Auth-User: Auth-Pass: Auth-Protocol: smtp Auth-Login-Attempt: 1 Client-IP: 192.0.2.42 Client-Host: client.example.org Auth-SMTP-Helo: client.example.org Auth-SMTP-From: MAIL FROM: <> Auth-SMTP-To: RCPT TO: <[email protected]> 我可以从Web应用程序中做出正确的决定,只要authentication不是无时就可以使用。 但是,当身份validation(LOGIN或PLAIN)时,我不知道Auth-SMTP-From是否会被发送到auth_http 。 我在正确的轨道上? 可以这样做吗? 有另一种方法吗? 更好的方法?
我有两个实例在Ubuntu 12.04上运行在相同的Azure VM服务器上。 Azure在默认情况下给我提供了PUBLIC VIRTUAL IP (VIP) ADDRESS和INTERNAL IP ADDRESS所以configurationpassproxy并不是那么明显。 我的例子是: Nginx + Gunicorn(Main,Django App)在端口内部端口8080(80为公共IP) Nginx + Apache(第二个)在内部端口5050(公众5000) 我想从实例2看起来像第一个有限的页面数量。 例如,页面my_public_ip:5000/data应该看起来像my_public_ip/data 。 同时一次应该服务所有其他页面。 你能帮我吗? 我目前的第一个例子NGINX conf: server { listen 8080; server_name my_internal_ip; port_in_redirect off; location = /favicon.ico { access_log off; log_not_found off; } location /static/ { root /home/path/to/static; } location / { include proxy_params; proxy_pass http://unix:/home/path/to/gunicorn.sock; […]
我刚在DigitalOcean有一个新的服务器,想尝试一些其他的东西。 我想开始一个WordPress的网站,所以我按照从这里第1-3步骤: https : //deliciousbrains.com/hosting-wordpress-yourself-nginx-php-mysql/ 。 起初一切顺利,我确实设法安装了wordpress。 不幸的是,我目前在我的网站上有403个Forbidden。 我在Ubuntu 14.04 x64上。 我已经坚持了一段时间,仍然没有什么想法。 我甚至试图删除Nginx并重新安装,仍然是一样的。 这是我的conf文件: 用户sylvia; worker_processes 1; pid /run/nginx.pid; 事件{ worker_connections 1024; #multi_accept on; } http { ## # 基本设置 ## 发送文件; tcp_nopush; tcp_nodelay; keepalive_timeout 15; types_hash_max_size 2048; #server_tokens off; client_max_body_size 64m; #server_names_hash_bucket_size 64; #server_name_in_redirect off; 包括/etc/nginx/mime.types; default_type application / octet-stream; ## #logging设置 ## access_log […]
目前,我们正在使用nginx作为我们主要的前端服务器,以Mesos-DNS为基础的dynamicDNS服务发现支持的一组服务。 我们的nginxconfiguration看起来有点像这样; http { resolver 10.10.1.1 valid=1s; // some internal DNS server } server { set $core_api core-api-service.marathon.mesos; // some internal DNS location /api { proxy_pass $core_api:8080; // resolve core_api DNS dynamically to one of the IP's of the slave the process is running + listening on } } 现在的问题是这个设置工作正常,但是4-5个请求中的一个总是导致Nginx丢回404,这是没有意义的,因为在集群内运行的服务没有移动到不同的从设备。 现在,parsing器valid=1s是相当积极的,所以我们把它延长到更长的时间,认为也许是太频繁地查询DNS。 但是,任何价值都会导致同样的问题。 删除valid=xx也没有帮助。 这里发生了什么? 我们如何减轻这一点? […]
所以有一点背景。 我正在将网站从使用Apache的旧服务器迁移到使用NGINX代理到Apache的新Ubuntu服务器。 将有一个过渡期,网站代码库将在新老服务器上运行。 该网站的searchurl与filter是斜杠分开,往往是可选的,例如 www.example.com/search/deals/q1/q2/q3/q4/q5/q6/ 它映射到以下apache.conf重写规则: RewriteRule ^/search/deals/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/ /results.php?q1=$1&q2=$2&q3=$3&q4=$4&q5=$5&q6=$6 [L,QSA] 有像下面的url是不寻常的 www.example.com/search/deals/q1////q5/q6/ www.example.com/search/deals/q1/q2/q3///q6/ www.example.com/search/deals/q1/q2/q3/q4/// 在新服务器上,我configuration了NGINX,如下所示:两个站点启用了默认的服务器apache文件和example.com文件 /etc/nginx/sites-enabled/apache -> ../sites-available/apache /etc/nginx/sites-enabled/example.com -> ../sites-available/example.com Apache看起来像这样(真正的IP由10.10.10.10取代): server { listen 10.10.10.10:80 default_server; merge_slashes off; #have tried with/without location / { proxy_redirect off; #have tried with/without port_in_redirect off; #have tried with/without proxy_pass http://10.10.10.10:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto […]
我正在尝试使用在端口80上运行的现有nginx来代替Apache服务于一个Wordpress网站。 添加了nginx部分(有些评论testing有意留下,我试了很多版本抱歉,如果看起来不对): upstream wordpress { server 127.0.0.1:5000; } server { server_name media.raw-news.net; access_log /home/plumi/PLUMI/plumi.app/var/log/wordpress-access.log; error_log /home/plumi/PLUMI/plumi.app/var/log/wordpress-error.log; #root /usr/local/apache2/htdocs/; location / { proxy_redirect off; proxy_pass http://wordpress; proxy_connect_timeout 75; proxy_read_timeout 185; } location ~ .*\\.(php)$ { proxy_pass http://wordpress; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; […]