Articles of nginx

Ubuntu上的Nginx + PHP-FPM在上传Joomla扩展zip文件时给出“上游发送无效状态”

我有一个在ESV虚拟机环境中运行的Ubuntu服务器,我已经安装了一个带有这个configuration的web服务器: Nginx 1.0.5 带PHP-FMP的PHP 5.3.6 Mysql 5.1.62 我在这台服务器上安装了最新版本的joomla,当我尝试上传一个安装包(包含joomla的扩展文件的zip文件)时,在nginx日志文件中出现以下错误:“502 Bad Gateway” 2012/05/13 11:22:21 [错误] 19911#0:* 20上游发送无效状态“-1复制失败”,从上游读取响应头时,客户端:10.10.56.70,server:localhost,request:“POST /administrator/index.php?option=com_installer&view=install HTTP / 1.1“,上行:”fastcgi://127.0.0.1:9000“,主机:”radio.xx.xx“,referrer:” http:// radio。 xx.xx / administrator / index.php?option = com_installer “ 我search了所有的互联网,我已经改变了太多的PHPconfiguration参数,FPMconfiguration和Nginx的configuration,包括增加执行时间等,但我的问题仍然存在。 我很确定它与我的Joomla没有任何关系,问题是在networking服务器,但没有可用的日志消息,除了上面的消息。 任何人都可以帮我解决这个问题吗?

cx_Oracle – InterfaceError:无法获取Oracle环境句柄

我已经在Ubuntu 12.04上使用uWSGI在NGINX之后安装了Django。 我使用Postgresql作为应用程序的主数据库,但是我需要从Oracle数据库中检索一些数据。 我已成功安装了Instant Client和cx_Oracle,并且可以从命令行脚本和./manage.py shell中成功连接和查询Oracle数据库。 但是,当我通过uwsgi运行应用程序时,我收到以下错误: InterfaceError: Unable to acquire Oracle environment handle 我感到困惑,因为当我检查ORACLE_HOME和LD_LIBRARY_PATH它们是正确的,并在当时的环境可用。 另外,我正在使用instantclient版本11.2.0.3.0查询Oracle 10g数据库。 我已经在网上查了很多提议的解决scheme,但似乎没有任何工作在我的情况。 有人有什么我可以尝试下一步的指针? 非常感谢。

使用nginx设置代理

我正在尝试使用nginx设置代理,但它redirect而不是代理它(至less这是它的样子)。 我的虚拟主机configuration: server { listen 80; server_name proxy.example.com; location / { proxy_pass http://thepiratebay.se/; 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; proxy_read_timeout 90; proxy_buffers 32 4k; } } 我搞砸了吗? cURL request to my proxy的输出cURL request to my proxy : > GET / HTTP/1.1 > […]

为静态内容和php构build一个nginxconfiguration

我想用下面的语义编写一个Nginxconfiguration,用希望可读的psuedo-config表示: location /dir1/ /dir2/ { if (matches a .php file) { serve with php } else if (matches a non-.php file) { serve as static content } else { 404 } } else { serve with /index.php } 我该怎么做呢? 我有一个体面的Apacheconfiguration的感觉,但我没有足够的把握Nginx的理清try_files和location匹配和内部redirect和东西的语义。 关于如何构build这个的任何提示? 作为参考,我目前使用的基于mod_rewrite的configuration是 # Any URL not corresponding to a directory gets rewritten to index.php RewriteCond […]

WordPress升级到最新版本后服务器崩溃(nginx + php-fpm)

我在我的巨大博客(每天约30万人次)上将Wordpress从2.8.4升级到最新的3.3.2。 一切顺利,但我的服务器开始返回很多错误502,虽然它以前工作得很好。 它运行php-fpm&nginx与清漆caching,所以这可能意味着问题与后端交谈,例如php-fpm。 有人有类似的经验,有什么可以做的呢? 我应该调整哪些设置? 我不能增加太多的内存限制,因为负载已经很高了,但在升级之前它是完全稳定的。 16个孩子在php-fpmconfiguration,xeon,8gb ram,ssd,ubuntu nginx错误日志充满了这个: 2012/05/22 18:38:17 [error] 3643#0: *113267 connect() to unix:/var/run/php5-fpm.sock failed (11: Resource temporarily unavailable) while connecting to upstream, client: 123.45.6.7, server: site.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.site.com" PHP的日志是好的,没有什么不寻常的,只是这些退出消息可能是由于达到最大数量的请求: May 22 18:48:47.058006 [NOTICE] [pool www] child 9509 exited with code 0 after 253.130628 seconds from […]

nginx没有find目录,但Apache的

我使用Apache作为后端服务器和前端的nginx。 Apache监听端口8080和nginx到端口80.我所做的是有根指向公用文件夹foreach虚拟主机: <VirtualHost *:8080> ServerAdmin webmaster@localhost ServerName site.com ServerAlias site.com *.site.com DocumentRoot /var/www/site.com/public <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/site.com/public/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost> 这里是nginxconfiguration: server { listen 80; access_log /var/log/nginx.access.log; error_log /var/log/nginx.error.log; root /var/www/site.com/public; index index.php index.html; server_name site.com *.site.com; location / { […]

nginx:php-fastcgi运行但php文件不能执行

我最近设置了一个运行于FastCGI进程的PHP的nginx服务器。 服务器正在运行HTML文件,但PHP文件正在下载,而不是显示和PHP代码不处理。 这是我在nginx.conf中的: server { listen 80; server_name pubserver; location ~ \.php$ { root /usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; include fastcgi_params; } } 命令netstat -tulpn | grep :9000 netstat -tulpn | grep :9000显示以下内容,指示php-fastcgi正在运行并监听端口9000: tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 2663/php-cgi 如果这是我的服务器在CentOS 6上运行的重要性,并且我使用Fedora项目的软件库安装了nginx和PHP。

清除3.0.2到Apache2有时会返回错误503

嘿家伙,我希望你能帮我在这里。 我有一个NgingxparsingHTTP和https清漆caching(3.0.2)。 从清漆发送到apache2。 现在我有一段时间一直在跟踪一些奇怪的503错误。 但我似乎找不到银弹。 目前我通过varnish通过这种方式logging503错误: sudo varnishlog -c -m TxStatus:503 >> /home/rj/varnishlog503.log 然后引用apache访问日志来查看是否处理了503个请求。 今天,我从防火墙的健康检查失败: 20 SessionOpen c 127.0.0.1 34319 :8081 20 ReqStart c 127.0.0.1 34319 607335635 20 RxRequest c HEAD 20 RxURL c /health-check 20 RxProtocol c HTTP/1.0 20 RxHeader c X-Real-IP: 192.168.3.254 20 RxHeader c Host: 192.168.3.189 20 RxHeader c X-Forwarded-For: 192.168.3.254 20 […]

为什么SERVER_PORT不总是传递给我的应用服务器?

我有一个非常无聊的nginx作为一个应用程序服务器的反向代理。 但有时我的上游得到的环境variablesSERVER_PORT,有时它不。 任何人都build议为什么它不一致或我可能会排除故障? upstream starman { server unix:/var/run/starman.sock; } server { <snip> location / { proxy_pass http://starman; proxy_set_header SERVER_PORT $server_port; }

使用inbox.py和nginx处理电子邮件

我有一个Flask web应用程序,运行在gunicorn和Nginx之后。 Nginx将ivrhub.org的所有stream量代理到正确的烧瓶应用程序。 我非常想使用inbox.py来处理一些传入的电子邮件。 在我的服务器上运行inbox.py的示例,然后发送一封电子邮件到[email protected]并不像我想的那样工作。 inbox.py服务器似乎没有收到任何东西,但电子邮件也不会反弹。 我在概念上错过了一些东西 – 是否需要configurationDNS设置,或者需要使用Nginx进行调整?