Articles of nginx

空白页Nginx 1.10 WordPress PHP7.0-FPM

我一直在寻找几个小时。 我发现了很多类似的情况,不知道我为什么不匹配。 当我去我的url时,我得到一个502错误的网关错误。 现在使用当前的设置,这只是一个空白页面。 我猜一个文件无法find,但我一直没能find任何错误或遗漏的东西。 我在Ubuntu 16.04 LTS,Nginx 1.10,PHP 7.0 FPM,MySQL。 我需要分享其他东西吗? 感谢大家的帮助。 nginx.conf user www-data; worker_processes auto; pid /run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; client_body_buffer_size 128k; ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; […]

任何虚拟环境都可以为所有virtuenenv启动systemd gunicorn.service吗?

如果你不在一个环境中工作,Gunicorn将被安装在全球范围内(即全系统可用)。 这不被推荐。 总是select使用virtualenv。 但是,如果你有多个virtualenvs多lessgunicorn.service文件,你应该启动在系统启动gunicorn? 例如下面 WorkingDirectory=/home/myproject… ExecStart==/home/myproject/myprojectenv/bin/gunicorn… 任何虚拟环境能否为所有virtudenv启动?

在读取来自上游的响应头时,FastCGI在stderr中发送

我最近在我的VPS上安装了Nginx(已编译)+ PHP7-fpm + MariaDB! 而我看到我所有的nginx /日志文件这个错误: 2017/11/17 17:45:15 [error] 23573#23573: *7 FastCGI sent in stderr: "PHP message: verify error, responseINVALID" while reading response header from upstream, client: 151.xxx.xxx.xxx, server: example.com, request: "GET /wp-admin/index.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.1-example.sock:", host: "www.example.com", referrer: "https://www.example.com/wp-admin/index.php" 2017/11/17 17:45:18 [error] 23573#23573: *13 FastCGI sent in stderr: "PHP message: verify error, responseINVALID" while […]

如何在Elastic Beanstalk AWS上修改NGINX路由? (SO x-post)

这是我在Stack Overflow问题上的一个交叉post,但是我觉得这个问题很值得我们去问这个社区。 这可能是更有针对性的在这里。 (你可以看到原来的post在这里https://stackoverflow.com/questions/47361467/how-do-i-modify-nginx-routing-on-elastic-beanstalk-aws )。 我不会再读整个post,但是问题归结为: AWS Elastic Beanstalk上的NGINX文件的默认configuration是什么? 将一个Docker化的容器上传到Elastic Beanstalk将会打破它,并且在线上有很多相互竞争的解决scheme,其中没有一个似乎可行,而且没有一个似乎是规范的。 我已经在修改.ebextensions的.conf文件的path中replace了00_elastic_beanstalk_proxy.conf ,但是我的更改的configuration都没有成功,或者它们引入了难以debugging的新错误。 如果有人对如何解决这个问题有什么build议,或者我可以采取什么措施来推进,请让我知道,因为我有点卡住了。

nginx接受本地networking连接,但不接受外部NAT

我有一个Ubuntu 16.04.3 LTS,有两个networking接口***.20和***.30 到443外部连接被路由器端口转发到***.30接口。 概要: 当我试图从外面打开任何页面时,nginx不工作(没有连接被接受)。 经过: 在浏览器http://***.30/和https://***.30/打开时,nginx工作(即接受连接,显示首页) 当我closuresnginx并运行sudo ncat -l ***.30 80和从外部telnet mydomain.com 80 ,可以看到我的双面打字。 我认为,湿dns +端口转发+ iptables。 问题: 我还能检查什么? 任何指针? 我可以从页面从本地***.30界面打开的事实假设正确的nginxconfiguration吗? 转储,编辑 运行nginx: nginx version: nginx/1.13.6 built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) built with OpenSSL 1.0.2g 1 Mar 2016 TLS SNI support enabled netstat的: Proto Recv-Q Send-Q Local Address Foreign Addr State […]

nginx proxy_pass更改url

我有以下nginxconfiguration: location /a/b/ { proxy_pass http://website1/abc; } location /a/c/ { proxy_pass http://website2/xyz; } 位置/a/b工作正常,在这种情况下URL不会改变,但是当我加载/a/c位置时,整个页面被redirect到http://website2/xyz 。 我不想要这个,我只是想加载/a/c下的http://website2/xyz的内容。 是否有任何想法可能是背后的原因/a/b proxy_pass工作correclty,同时/a/c完全redirect?

升级到Ubuntu 17.10 rutorrent和nginx web控制台后停止工作

我没有从Ubuntu 17.04升级到17.10,rutorrent停止使用nginx。 在networking中,我看到以下错误: Blockquote [19.11.2017 17:43:07]来自服务器的错误响应:(502 [error,getplugins])错误的网关[19.11.2017 17:43:07]来自服务器的错误响应:(502 [error,getuisettings])502错误的网关 502错误的网关 nginx Blockquote 在nginx错误日志中,我有以下条目 Blockquote 2017/11/17 14:54:16 [crit] 1234#1234:* 2连接()到unix:/var/run/php/php7.0-fpm.sock失败(2:没有这样的文件或目录)当连接到上游时,客户端:192.168.255.109,服务器:192.168.255.125,请求:“POST /rutorrent/php/getsettings.php HTTP / 1.1”,上游:“fastcgi:// unix:/ var / run / php / php7.0-fpm.sock:“,host:”192.168.255.125“,referrer:” https://192.168.255.125/rutorrent/ “Blockquote 没有错误在PHP日志。 / var / run /不包含任何php文件/条目。 我安装了etckeeper,并在/ etc中检查了升级过程中是否有任何更改,而且我没有看到任何更改。 我该如何解决这个问题? 干杯Wojciech

nginx cors设置抱怨.global域名

我对nginx很新,想要设置cors安装程序: 我检查了这个网站 我的问题是nginx在重启之后抱怨,因为: nginx: [emerg] pcre_compile() failed: a numbered reference must not be zero in "^https?://(localhost|xxxxxx.\global)" at "global)" in /etc/nginx/nginx.conf:111 而这个configuration是: if ($http_origin ~ '^https?://(localhost|XXXXXXX.\com)') { 我的问题是:如何告诉nginx使用.global域名?

使用CNAME和SSL访问SaaS应用程序

我们使用nginx作为web服务器运行一个SaaS应用程序。 现在,我们希望允许我们的客户在我们的应用程序中使用自己的域名,并设置一个CNAME别名。 我目前正在使用CNAME进行testing,并且首先得到一个SSL错误,导致应用程序configuration了一个通配域证书,用于我们自己的域。 但是对于CNAME,由于其他域,证书显示安全错误。 所以我为第二个域创build了一个证书,并更新了我的nginxconfiguration,使用这个证书在CNAME别名页面上进行连接。 但是现在我得到一个NET :: ERR_CERT_COMMON_NAME_INVALID错误,因为错误的证书被发送回客户端。 如果我打开我们的应用程序的子域,我看到正确的证书发送。 如何检查nginx使用哪个服务器configuration来进行CNAME请求?

如何在centos中启动gunicorn作为服务6

我使用下面的configuration文件在centos 7中启动gunicorn作为systemd servivce。 但systemd没有在centos中find6.那么如何启动gunicorn作为服务? [Unit] Description=gunicorn daemon After=network.target [Service] User=centos Group=centos WorkingDirectory=/opt/myapp/ ExecStart=/opt/venv/bin/gunicorn –workers 3 –bind 127.0.0.1:8080 controller.wsgi:application [Install] WantedBy=multi-user.target 上面的文件被复制到“/etc/systemd/system/gunicorn.service”在centos 7.但是我怎样才能在centos 6中实现相同的?