Articles of nginx

Nginx未能满足Vagrant / Puppet的依赖

我在64bit的Ubuntu Precise上没有这样的问题,但是一旦我尝试启动32位机器,它在这个命令上失败: # /usr/bin/apt-get -q -y -o DPkg::Options::=–force-confold –force-yes install nginx=1.6.0-1+precise0 Reading package lists… Building dependency tree… Reading state information… Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been […]

还有另一个与NginX的502错误

我试图把一个服务器@家到位与一些基本的服务。 所有服务都运行在专用的虚拟机上。 每个虚拟机托pipe在vSphere 5.5上。 到目前为止我有: 用nginx作为反向代理的Debian喘气:192.168.1.12 使用nodeJS作为webapp服务器的Debian喘息:192.168.1.43 192.168.1.43:3000 =>在192.168.1.43:3001上进行redirect的http web服务器 192.168.1.43:3001 => https服务器提供的服务 Debian喘气madsonic安装:192.168.1.35 正如在文档中所说,我把–https-port = 443在configuration中启用https访问 我使用nginx能够有这样的事情: myapp.mydomaine.com =>转到nodejs @ 192.168.1.43 music.mydomain.com =>去madsonic @ 192.168.1.35 我遵循一个教程,并在/ etc / nginx / sites-enabled中编辑了“默认”文件。 以下是它的样子: server { listen 80; server_name myapp.domaine.com; location / { proxy_pass http://192.168.1.43:3000; } } server { listen 443; server_name myapp.domain.com; ssl on; ssl_certificate […]

Nginx,server_name定位尾随“。”将不会redirect

当你input“dev1.example.com”。 进入你的浏览器,或者你用HTTP客户端请求该主机,我希望它redirect到“dev1.example.com”。 我试图用下面的服务器块来做到这一点: server { listen 80; server_name dev1.example.com.; add_header Pragma no-cache; add_header Expires "Sat, 01 Jan 2000 00:00:00 GMT"; add_header Cache-Control "private, no-cache, no-store, max-age=0, must-revalidate, post-check=0, pre-check=0"; return 301 http://dev1.example.com$request_uri; } 但是,似乎没有任何事情发生。 我试图清除我的DNSparsing器caching,清除我自己的浏览器的DNScaching,我甚至用curl请求URL。 我所要求的url是“dev1.example.com”。 我希望它redirect到“dev1.example.com”。

在vhost error.log中loggingPassenger中的错误

我使用nginx运行Phusion Passenger 4.0.40。 服务器用于托pipe多个网站,每个网站都有自己的error.log文件。 但是,如果应用程序在启动过程中崩溃,则不error.log错误消息写入网站的error.log ,而是写入全局error.log 。 由于全局error.log不能被网站访问,所以很难debugging这个问题。 有没有办法将console.log()从全局error.log启动错误redirect到网站的error.log ? 这里是nginxconfiguration的相关部分: error_log logs/error.log; http { passenger_friendly_error_pages off; } server { passenger_enabled on; error_log /var/www/subdomain/log/error.log; } 任何帮助表示赞赏。 谢谢

无法在CentOS上使用LEMP安装phpmyadmin

我在安装phpmyadmin时遵循以下步骤。 1启用EPEL回购 2 – 下载并提取phpmyadmin到/ usr / share / 3将config.sample.inc.php复制到config.inc.php文件中 4 – 创build/etc/nginx/conf.d/phpmyadmin.conf并添加 server { listen 8080; # listen port server_name localhost; # Server name location / { root /usr/share/phpmyadmin; # Document root index index.php index.html index.htm; } location ~ \.php$ { root /usr/share/phpmyadmin; # Document root fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include […]

nginx偶尔发生uwsgi错误

nginx和uwsgi偶尔会出现502错误的网关错误。 检查我的uwsgi日志文件,我偶尔会看到 uwsgi_proto_uwsgi_parser(): Error 0 [proto/uwsgi.c line 35] 我做了一个负载testing,我收到了285个成功的请求和4个不好的请求。 上面的行在该文件中出现了四次,所以它肯定是导致问题的错误。 我没有find任何关于这个具体错误的信息。 任何人有任何build议? 我不会在加载时发生这个错误,因为有时候我只是在一次testing我的应用程序时自己发出一个请求。 这是我如何开始uwsgi uwsgi-3.3 –socket /tmp/uwsgi.sock –wsgi-file RunOperation.py –master –processes 4 –threads 2 –stats 127.0.0.1:9191 –daemonize /root/uwsgi/log.log –pidfile /root/uwsgi/pidfile.txt –vacuum 这是我的nginxconfiguration的相关部分 uwsgi_pass unix:///tmp/uwsgi.sock; uwsgi_param QUERY_STRING $query_string; uwsgi_param REQUEST_METHOD $request_method; uwsgi_param CONTENT_TYPE $content_type; uwsgi_param CONTENT_LENGTH $content_length; uwsgi_param REQUEST_URI $request_uri; uwsgi_param PATH_INFO $document_uri; uwsgi_param DOCUMENT_ROOT $document_root; […]

nginx auth_basic 401 htpasswd

我有这个奇怪的错误: 我有一个运行在8090的Jenkins服务,我想通过Nginx的auth_basic和proxy_pass进行密码保护。在没有auth_basic的情况下执行proxy-pass时,我可以访问这个站点,没有问题: server { listen 8080; location / { proxy_pass http://localhost:8090; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; proxy_buffering off; proxy_pass_header Authorization; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # auth_basic "Restricted"; #For Basic Auth # auth_basic_user_file /etc/nginx/htpasswd; #For Basic Auth } } 但是,取消注释这两个身份validation行。 我在浏览器中获得预期的login页面。 如果我input无效的凭据,我在nginx / error.log中得到预期的错误: (错误的用户) 2014/07/30 […]

将Openresty编译为一个.deb包

我正在尝试使用FPM将Openresty 1.7.2.1编译为Debian 7的.deb软件包。 虽然FPM编译成功,我得到一个deb文件,但是当我使用dpkg安装它时,configuration文件并没有被放置在/ etc / nginx中,显然当我运行/ usr / sbin / nginx时,我得到: nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (2: No such file or directory) 以下是我正在编译的步骤: ./configure –with-luajit \ –sbin-path=/usr/sbin/nginx \ –conf-path=/etc/nginx/nginx.conf \ –error-log-path=/var/log/nginx/error.log \ –http-client-body-temp-path=/var/lib/nginx/body \ –http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ –http-log-path=/var/log/nginx/access.log \ –http-proxy-temp-path=/var/lib/nginx/proxy \ –lock-path=/var/lock/nginx.lock \ –pid-path=/run/nginx.pid \ –with-pcre-jit \ –with-pcre \ –with-http_ssl_module \ –without-http_redis2_module \ –without-http_redis_module \ […]

Atlassian人群+ Nginx + SSL安装不工作 – redirect循环

nginxconfiguration: server { listen 443 ssl; server_name crowd.example.com; access_log off; client_max_body_size 10M; ssl_certificate /etc/nginx/ssl/crowd.example.com.crt; ssl_certificate_key /etc/nginx/ssl/crowd.example.com.key; location / { proxy_pass http://localhost:8095/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; port_in_redirect off; proxy_redirect https://crowd.example.com/ /; } } 来自server.xml的人群相关部分: <Service name="Catalina"> <Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" port="8095" redirectPort="8443" useBodyEncodingForURI="true" URIEncoding="UTF-8" proxyName="crowd.example.com" proxyPort="443" scheme="https" […]

在Fedora 19中设置nginx的根目录

所以我有nginx设置与默认站点。 我决定我想改变,因为我的网站在/var/www/site/ …所以在我改变之前,我去了127.0.0.1看看是否一切正常。 我做了。 我得到了This page is hosted by nginx! 好,好 现在我要把root directores移动到/var/www/site因为我在那里得到了一个index.html文件。 然后我重新启动…我得到这个错误: 2014/08/07 01:42:35 [error] 24949#0: *1 "/var/www/site/index.html" is forbidden (13: Permission denied), client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", host: "127.0.0.1"