Articles of nginx

Nginx + PHP没有findindex.php 404

我用nginx 12和php7.1运行debian 9 我已经设置好了。 Nginx不会在错误日志中给我任何东西,所有的PHP脚本都100%正常工作。 Nginx索引index.html作为索引,但没有findindex.php并返回404,即使我已经在nginxconfiguration中设置它。 这是我的nginxconfiguration: server { listen 80 default_server; listen [::]:80 default_server; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: […]

IIS(作为客户端)和NGINX(作为服务器)之间的TLS错误

感谢您阅读这篇文章。 我事先道歉,链接必须复制粘贴; 我没有足够的声望来添加2个以上的链接。 这篇文章是扩展到另一个问题,我有(这是固定的)链接:serverfault.com/questions/866157/ssl-personal-certificate-link-to-intermediate-certificate-is-broken/866330#866330 我有一个testing服务器,我试图使用SSL / TLS实现encryption通信。 通信是在IIS(远程服务器上的web服务器,其中asp.net应用程序已经发布)和NGINX之间进行的。 在这里,IIS因此发送数据,我相信情况是IIS是客户端和远程服务器NGINX是服务器根据本教程中提到的TLS客户端 – 服务器交换blog.cloudflare.com/introducing-tls-client-authentication/ 在上述教程(与TLS客户端身份validation握手)的第3步中,NGINX请求证书,IIS应该发回它的证书。 当NGINX向IIS发送一个证书请求时,IIS正在向NGINX发送一个空的证书。 在Windows服务器中的中间证书是NGINX所期待的。 以下是两个服务器的SSL检查器的快照: nginx和iis 我以为这个设置会起作用,但是不行。 另外,由于在这种情况下IIS是客户端,是否必须在iis中安装客户端身份validation证书。 现在,这是服务器authentication证书。 如果我必须安装客户端身份validation证书,那么如何让iis在使用tls进行通信时使用它。 谢谢

NginX反向代理服务器到后台networking服务器不正确显示网站

我没有看到有关如何解决这个问题的任何post,所以我试着问自己。 我运行在一个单独的虚拟机上的每个networking服务器,代理也在自己的虚拟机。 一切运行Ubuntu 17.04 所以让我们先弄清事情: 我设置了一个NginX代理服务器来为domain1.com和domain2.com服务。 除了有些内容在通过域连接时不会被加载/显示给客户端时,所有东西都可以工作。 它似乎不加载一些图像和/或CSS文件。 我认为它加载的唯一的事实上是HTML文件,但我不完全确定。 在内部IP一切工作就好了。 顺便说一句,即时只使用HTTP现在。 我对NginX的默认configuration是不变的,我的代理configuration如下(每个服务器块就是这样,键值明显改变): listen 80; server_name amco.hopto.org www.amco.hopto.org; access_log off; location / { proxy_pass "http://10.10.10.204"; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; proxy_temp_file_write_size 256k; proxy_connect_timeout 30s; } 那我该如何解决这个问题? 我真的想坚持NginX,因为我不想再次转身,并坚持学习这一点。 另外,请原谅,如果我不明白你的意思,如果它的advnaced的东西,因为即时通讯相当新的代理。 加载失败的一些例子是: amco.hopto.org amco-cloud.hopto.org 另外,加载时间不是最佳的,但那是另一回事。

服务器达到pm.max_children设置(280),考虑提高它

PHP-FPM进程因为达到pm.max_children而每隔几天就会崩溃 ,我必须手动启动它才能build立站点。 服务器configuration: Total Memory: 7986M CPU: 2 Core 1 PHP Process Taking: 22M PHP-FPMconfiguration: pm = dynamic pm.max_children = 280 pm.start_servers = 15 pm.min_spare_servers = 15 pm.max_spare_servers = 35 pm.max_requests = 1000 检查PHP-FPM日志,发现以下错误。 [02-Aug-2017 23:23:54] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 10 […]

使用NginxconfigurationWindows IIS身份validation

我是ASP.NET Core和Nginx的新手。 如果这个问题看起来蹩脚,请和我一起。 我有一个使用IIS Express托pipe的web api,它使用端口号17770运行在我的本地主机上。我还在使用端口号8070的localhost中安装了Nginx。 目标是对通过Nginx使用IIS Express托pipe的API进行基本身份validation。 这是我的configuration文件。 我想知道如何testing天气configuration工作和validation我的networkingapi。 #user nobody; worker_processes 1; worker_rlimit_nofile 8192; error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; pid logs/nginx.pid; events { worker_connections 1024; accept_mutex off; } http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log logs/access.log […]

webdav和硬链接函数没有实现的错误信息

我有用于将文件传输到远程服务器的nginx的webdav。 我在Debian盒子上使用davfs2进行安装。 问题是,当我尝试创build一个硬链接时,我得到以下错误信息: ln: failed to create hard link 'cpool/test' => 'pc/test': Function not implemented 有没有解决方法?

无法通过WebSockets与nginx代理连接

我的设置包含在http:// localhost:9222上运行的无头Chrome实例。 如果我通过WebSocket客户端直接连接它,它将起作用。 我想把一个Nginx服务器块作为代理放在它的前面(稍后我会添加authentication等)。 我的configuration是: server { # Logic configuration server_name chrome.example.eu; access_log /opt/chrome/access.log; error_log /opt/chrome/error.log; location / { proxy_pass http://127.0.0.1:9222; proxy_http_version 1.1; proxy_set_header Host $host; location /devtools/page/ { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_read_timeout 86400; } } # Networking listen 80; } HTTP部分工作正常。 Chrome开发工具的用户界面显示,如果我打开http://chrome.mydomain.eu 。 但是,websocket连接无法build立。 浏览器尝试连接到ws://chrome.example.eu/devtools/page/6877e641-fc1e-4196-bb55-0c3e1608af4a但服务器不会升级到WebSocket连接。 Nginx发回一个404响应,并且error.log包含一个我无法理解的行: * 690 open()“/ usr / […]

Nginxredirect到请求url剥离index.php或index.html

我有一个url: http://devs.website.com.au/ 然后,如果我把这个url在浏览器中 http://devs.website.com.au/index.php 我正在redirect到 http://devs.website.com.au/ 在nginx中使用这段代码可以正常工作 if ( $request_uri ~ "/index.(php|html?)" ) { rewrite ^ /$1 permanent; } 但是,如果我有这个现有的页面: http://devs.remotestaff.com.au/sample-page.php 然后我试了一下, http://devs.remotestaff.com.au/sample-page.php/index.php 正如预期的那样,它会重新回到: http://devs.website.com.au/ 在我的nginx规则中定义,是否有一种方法,每当nginx看到index.php或index.html在URL的末尾,它将redirect到请求的url没有index.php或index.html 所以当我这样做: http://devs.remotestaff.com.au/sample-page.php/index.php : http://devs.remotestaff.com.au/sample-page.php/index.php 它应该redirect到: http://devs.remotestaff.com.au/sample-page.php/

如何将HAProxyconfiguration为从path中获取后端uri?

我想使用HAProxy作为反向代理,并从path中取回后端主机: http://haproxy/web1/index.html – > http://web1/static/index.html http://haproxy/web2/index.html – > http://web2/static/index.html … 后端服务器是dynamic的,不应该被硬编码。 我设法用nginx来实现,但是我无法用HAProxy实现同样的function。 server { listen 80; server_name localhost; location ~ ^/(.*)/(.*) { proxy_pass http://$1/static/$2; } } 用HAProxy做这个是不是一个好主意,还是应该坚持用NGINX?

nginx:返回模板化的string文字

我想处理具有半静态内容的特定URL参数的请求。 具体来说,任何具有go-get=1请求应该返回一个静态响应,并带有几个replace。 我可以从原始URL中提取replacestring。 我基本上想要的是这样的: if ($arg_go-get = "1") { # This is a go-get operation. ^/([^/]*)(/.*)?$ return 200 ' irrelevant stuff $1 '; } 今天,我们重写一个文件,但我不想填充文件,我只想要所有的input匹配和模板自动。