nginx-cache 相关问题


Yocto中sstate-cache目录应该如何删除?

我的 YoctoProject“fido”环境的 sstate-cache 目录大小超过 3GB。 如何删除 yocto/build-dir 中的 sstate-cache 目录? 使用 rm -rf 是否安全或者是


Docker 镜像 NGINX 未公开:无法访问站点

1。我正在使用本指南来获取要运行的 nginx 网络服务器映像并使用命令 docker run -p 8888:80 nginx docker run -p 80:80 nginx 我猜有两个或更多容器启动并运行......


Nginx 无法通过index.html 提供媒体服务

我对 Nginx 还很陌生。我想要实现的是使用它的 Docker 映像来为我的网页(及其所有媒体)提供服务。 我的项目结构: 。 ├── nginx │ ├──conf.d │ └── nginx.conf └── w...


Nginx + Express - 从 Docker 容器提供静态文件

我在 Docker 容器中有一个 Express api 和一个 Nginx。我希望 Nginx 反向代理对 API 的常规请求,但我希望它直接提供图像等静态文件。 但我...


Nginx:在重定向期间保留端口

我有一个 Nginx 服务器监听在 Docker 容器内运行的 80。 在 Nginx 配置中,我需要在特定情况下执行到静态页面的重定向。 重写 ^ /foobar.html 重定向...


在 nginx 入口中打开 TCP 连接

我在通过 nginx-ingress 打开 TCP 连接时遇到问题。 所以我的目标是我想在我的 Kubernetes 集群上使用 Nginx-Ingress 在端口 9000 上打开 Clickhouse TCP 连接。 到目前为止,我可以...


有条件地启用 Maven 扩展?

我们想尝试 Maven 构建缓存扩展,您可以通过将以下内容放入 .mvn/extensions.xml 来启用它: org.apache.maven.extensions 我们想尝试 Maven 构建缓存扩展,您可以通过将以下内容放入 .mvn/extensions.xml 来启用它: <extension> <groupId>org.apache.maven.extensions</groupId> <artifactId>maven-build-cache-extension</artifactId> <version>1.1.0</version> </extension> 但是,在我们确信这不会带来问题之前,我们希望默认情况下禁用它,然后仅当您在命令行上设置标志时才启用它。 但是 extensions.xml 的文档 没有指定任何有条件地启用/禁用特定扩展的方法。 如何有条件地启用或禁用 Maven 扩展? 我发现一个blog提到了如何禁用maven缓存。请阅读它。它包含您正在寻找的所有信息。 您可以通过 xml 和命令行参数来完成。 命令行: mvn clean install -Dmaven.build.cache.enabled=false XML: <cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.0.0 https://maven.apache.org/xsd/build-cache-config-1.0.0.xsd"> <configuration> <enabled>false</enabled> </configuration> </cache>


Nginx 入口控制器 - 无法使用主机名访问 AKS Azure 负载均衡器

我有一个私有 AKS 集群,并且正在使用 nginx 入口控制器。到目前为止,我已经做了以下事情。 安装 nginx 入口控制器 命名空间=jananath-test helm 升级 --安装 ingress-n...


NGINX 请求转发时使用美元符号 URL

我想设置NGINX,以便所有以下形式的请求: example.com/$ example.com/$/ example.com/$/a example.com/$/a/ example.com/$/a/b/ 被转发到一台上游服务器,其他一切都是


Nginx无限文件上传

当我尝试将文件上传到我的服务器时,我得到无限上传。不过,上传文件效果很好。 我的/etc/nginx/nginx.conf: 用户www-数据; 自动worker_processes; pid /run/nginx.pid; 包括/etc/


构建 pygdal 时出错:未知的分发选项:“use_2to3_fixers”和“use_2to3_exclude_fixers”

解决方案如下: 在 Ubuntu 20.04 上构建 pygdal 时开始出现错误: # 命令 python3 -m pip install --no-cache-dir pygdal==3.0.4.* 产生以下输出 收集 pygda...


Nginx 和 Traefik 的性能非常慢

我们有以下基础设施来部署 PHP 应用程序: 运行 Nginx 作为代理的 VM Docker Swarm 集群中有 3 个节点 Traefik 容器部署在这个集群中(所以我们有 3 个包含...


如果请求与路径不匹配,如何让 Nginx 返回 444?

简短版本: 我想使用 NGINX 作为反向代理,以便访问面向公众的 URL 的客户端从代理后面的内部 Gunicorn 服务器获取 API 数据: 外部PA...


Nginx 安全链接和 java

我有一个项目,我需要从我的服务器流式传输视频,我使用 nginx 来完成它,还使用 spring mvc 开发的 webapp 和 tomcat 来包含它。 怎么运行的: java应用程序制作md5哈希...


如何确定对象从 Varnish Cache 中删除的原因?

我们有一个 Varnish 服务器在 Magento 站点前面运行。我们发现 Magento 在提供页面时非常慢,因此我们希望 Varnish 提供所有类别和产品...


虚拟环境中的 Python 依赖项导致 ROS2 colcon 构建失败并出现 ModuleNotFoundError

当尝试构建我的 ROS2 项目时,由于缺少名为 em 的依赖项,我在编译其中一个 C 模块时收到 ModuleNotFoundError: % colcon 构建 --cmake-clean-cache 开始 >>>


本地主机上的 Nginx http 到 https 重定向出现页面重定向错误

我在 Ubuntu 中的 Nginx 本地主机上托管了一个简单的静态站点。但重定向代码给我错误“页面未正确重定向”。 提供问题的重定向代码是:


在 AKS 中使用 nginx 入口控制器,并使用工作负载身份从 Key Vault 中提取 TLS 证书终止

我正在将 AKS 与 nginx 入口控制器结合使用。 我正在使用包含 .key 和 .crt 的 kubernetes tls Secret 并将其引用到 ingress.yaml 中 Kubectl 创建秘密 tls $secret_name --key=...


如何在 istio ingress gateway 中配置以下 nginx 注解

如何在 istio ingress gateway 中添加以下 ssl-redirect 配置 nginx.ingress.kubernetes.io/ssl-redirect:“假” nginx.ingress.kubernertes.io/force-ssl-redirect:“假&...


程序接收信号SIGIO

我在 NGINX 的 error.log 中看到以下错误: [注意] 12451#0:收到信号29(SIGIO) 我想知道程序在什么情况下会收到 SIGIO?


带有 nginx-proxy 的 Docker:不允许附加属性名称

从 ubuntu 18 升级到 Ubuntu 20.04.6 LTS 后 Docker 停止工作 我正在使用 docker-compose 但它完全停止工作。所以我切换到“docker compose” 我现在正在尝试...


子路径 URL 404 上的 Keycloak 运算符

我正在尝试使用 Operator 将 Keycloak 部署到 kubernetes 集群上。 我需要该应用程序存在于“/auth”而不是“/”上。 我正在使用 ingress-nginx 入口控制器并创建入口...


在 NodeJs Express 中让 SocketIO 在 HTTPS 上工作

大家好, 将我的 NodedJs 应用程序推送到我的 ubuntu 服务器(使用 https 在 nginx 中提供站点)后,我遇到了问题。在我使用 localhost 的本地环境中,连接是


Nginx 正则表达式如果 url 以单词结尾则返回 404

类似 /admin/somefile 的 URL?某些参数应该可以工作 像 /admin/somefile?someparameters#authorize 这样的 URL 应该返回 404 所以我在网址末尾寻找“#authorize” 现在我是


后台应用程序间歇性工作

我们已经在AKS集群上部署了后台应用程序,并且我们的应用程序使用了nginx入口控制器,但是应用程序不稳定,它工作了2分钟,然后长时间宕机(


配置 SAML2:绕过“InResponseTo”验证,同时保留 OpenSaml4AuthenticationProvider 中的默认设置

我有一个在 Nginx 和 Spring Security 后面运行的 Java 后端应用程序用于 SSO。我的后端应用程序缺乏记住 cookie 会话的机制,因为 SSO 请求可能由...发起


使用加密的 sudo_password.yml 自动执行 Ansible Playbook:安全处理 Vault 密码

我对ansible的其中一项功能感觉不太满意。 对于我的场景,我想在我的托管节点上执行一个剧本来安装例如 nginx。 现在我的控制节点上有以下 playbook.ym...


在 Rails 5 中单击浏览器上的后退按钮时,带有 Select2 的表单会重复

_header.html.erb(用于表单部分) <%= form_for home_path, class: 'home', role: 'search', method: :get do |f| %> _header.html.erb(用于表单部分) <%= form_for home_path, class: 'home', role: 'search', method: :get do |f| %> <div class="form-group" style="display:inline;"> <div class="input-group input-group-md"> <%= text_field_tag :q, params[:q], placeholder: ... ,class: 'form-control hideOverflow', type: "search" %> <%= select_tag "category", options_from_collection_for_select(...),include_blank: true, class: 'form-control hideOverflow', type: "search" %> <%if logged_in? %> <%= select_tag "location", options_for_select([...], ...),class: 'form-control hideOverflow', type: "search" %> <% else %> <%= select_tag "location", options_for_select([...], ...),class: 'form-control hideOverflow', include_blank: true, type: "search" %> <% end %> <span class="input-group-addon"><%= submit_tag "Search", class: "btn-transparent"%></span> </div> </div> <% end %> JS代码 <script> $( document ).on('turbolinks:load', function() { $('select#category').select2({ width: '60%', dropdownAutoWidth : true, placeholder: "Choose a category", maximumSelectionLength: 3 }); $('select#location').select2({ width: '40%', dropdownAutoWidth : true, minimumResultsForSearch: Infinity }); }); </script> 故障或渲染问题(单击链接查看图像) 有人可以帮我解决为什么吗?另外,我的搜索表单位于标题部分文件的导航栏中。 如果我去掉脚本中的 $(...).select ,一切都会正常...我认为 select.js 有问题 在此回复: https://stackoverflow.com/a/41915129/5758027 我在自己的代码中使用了这个解决方案: $(document).on('turbolinks:before-cache', function() { // this approach corrects the select 2 to be duplicated when clicking the back button. $('.select-select2').select2('destroy'); $('.select-search-select2').select2('destroy'); } ); 和观察者: $(document).ready( ready ); //... once document ready $(document).ajaxComplete( ready ); //... once ajax is complete $(document).on('turbolinks:load', ready ); //... once a link is clicked function ready() { $(".select-search-select2").select2({ theme: "bootstrap", language: 'es', allowClear: true }); $(".select-select2").select2({ theme: "bootstrap", language: 'es', minimumResultsForSearch: Infinity, allowClear: true }); }; 总是清除缓存不是会让使用 Turbolink 变得毫无意义吗? 不如这样? $(document).on('turbolinks:before-cache', function(e) { return $('.form-control.select2').each(function() { return $(this).select2('destroy'); }); }); 我无法解决这个渲染问题(仍在等待正确的答案!),但如果有人像我一样遇到类似的问题,请尝试跳出框框思考。这是我的技巧:我在应用程序中添加了一个后退按钮。 获取完整的url路径 # get the previous url def save_previous_page session[:return_to] = request.fullpath end 仅当页面不是主页或搜索页面时才显示后退按钮 <% if session[:return_to] != request.fullpath%> <%= link_to session.delete(:return_to) || request.fullpath, class: 'back-button' do%> <i class="fa fa-arrow-circle-left" aria-hidden="true"></i> <%end%> <% end %> 同时,我仍在等待并尝试解决渲染问题... 解决了问题 只需将此代码添加到您的 .js 文件中 Turbolinks.clearCache(); 这很可能是一些资源不一致,您应该检查您的 app\views\layouts 文件夹中是否有重复声明 wither jQuery、jQuery UJS 或 Turbolinks 的文件。检查页面的所有 <script> 标签,以及是否在 layout 文件夹和内部视图中声明相同的脚本。如果情况并非如此,请检查是否有 render、yield 或 build 呼叫 简单的解决方案,不要在您不希望它运行的东西上运行 select2 构建器。 $("select#category:not(.select2-container):not(.select2-hidden-accessible)").select2(); Rails 7 更新 这里的很多东西在 Rails 7 中都不起作用,尤其是 turbolinks:before-cache 事件。您正在寻找的新事件是 turbo:before-cache 和 turbo:load,所以它看起来像这样: $(document).on("turbo:before-cache", function() { $("#select_id").select2('destroy'); }); $(document).on('turbo:load', function() { $('#select_id').select2(); });


与 docker 容器上的 nginx 发生反应 - 不加载 App.tsx

我有一个反应应用程序 当我在本地运行它时,它可以正常工作 npm 运行开发 我想让我的 React 应用程序在本地和带有 docker 镜像的 aws 上运行 我创建了这个泊坞窗图像: #


如何在不重新加载页面的情况下发送带有文件的表单?

我尝试在ajax中发送表单而不重新加载页面,但我看到,文件上的链接不存在...... 我有下一个表格: 我尝试在ajax中发送表单而不重新加载页面,但我看到,文件上的链接不存在... 我有下一个表格: <form id="settings" method="POST" enctype="multipart/form-data"> ... <input type="file" id="logo" style="display:none;" name="logo" accept="image/png, image/jpeg, image/gif"> <button type="submit" id="send" class="btn btn-primary">save</button> </form> Ajax 脚本: $('#settings').submit(function(e){ e.preventDefault(); var form = $(this).serialize(); alert(form); // file is not attached... $.ajax({ url : '/settings', type : 'POST', crossDomain : false, data : form, contentType : 'multipart/form-data', dataType : 'json', progressData: false, cache : false, success : function(r){ alert (111); } }).fail(function(){ console.log('Error occured!'); }); }); 在服务器端,我收到错误: org.apache.tomcat.util.http.fileupload.FileUploadException:请求被拒绝,因为未找到多部分边界 我尝试不序列化表单,而是写了 data : form -> data : new FormData(this) 此选项会导致错误“非法调用”。如何在不重新加载页面的情况下发送带有文件的表单? 要使用 AJAX 发送带有文件的表单而不重新加载页面,您需要使用 FormData 来正确处理文件上传。 <form id="settings" method="POST" enctype="multipart/form-data"> <!-- Other form fields --> <input type="file" id="logo" name="logo" accept="image/png, image/jpeg, image/gif"> <button type="submit" id="send" class="btn btn-primary">Save</button> </form> $(document).ready(function() { $('#settings').submit(function(e){ e.preventDefault(); var formData = new FormData(this); $.ajax({ url: '/settings', type: 'POST', data: formData, contentType: false, processData: false, cache: false, success: function(response){ alert('Form submitted successfully!'); // Handle the response from the server }, error: function(){ console.log('Error occurred!'); } }); }); });


PHP 函数 ssh2_connect 不起作用

以下是我的脚本: 以下是我的脚本: <?php $connection = ssh2_connect('XX.XX.XX.XX', 22); ssh2_auth_password($connection, 'root', '******'); $stream = ssh2_exec($connection, 'useradd -d /home/users/test -m testftp'); $stream = ssh2_exec($connection, 'passwd testftp'); $stream = ssh2_exec($connection, 'password'); $stream = ssh2_exec($connection, 'password'); ?> 它显示以下错误: Fatal error: Call to undefined function ssh2_connect() in /home/chaosnz/public_html/fotosnap.net/test.php on line 2 我该如何处理这个问题? 谢谢 老实说,我建议使用 phpseclib,这是一个纯 PHP SSH2 实现。示例: <?php include('Net/SSH2.php'); $ssh = new Net_SSH2('www.domain.tld'); if (!$ssh->login('username', 'password')) { exit('Login Failed'); } echo $ssh->exec('pwd'); echo $ssh->exec('ls -la'); ?> 它更加便携、更易于使用并且功能也更加丰富。 我已经安装了 SSH2 PECL 扩展,它工作正常,感谢大家的帮助... 我已经在 ubuntu 16.4 PHP 7.0.27-0+deb9u 和 nginx 上解决了这个问题 sudo apt install php-ssh2 您需要安装ssh2 lib sudo apt-get install libssh2-php && sudo /etc/init.d/apache2 restart 这应该足以让你上路 如果您在 OSX 上运行 bomebrew,我使用以下命令来安装它: brew install php56-ssh2 这对我有用。我从这里拉它。应该还有使用 mac 端口的 Ubuntu 和 OSX。 我正在运行 CentOS 5.6 作为我的开发环境,以下内容对我有用。 su - pecl install ssh2 echo "extension=ssh2.so" > /etc/php.d/ssh2.ini /etc/init.d/httpd restart 为了扩展 @neubert 答案,如果您使用 Laravel 5 或类似版本,您可以使用更简单的 phpseclib,如下所示: 奔跑composer require phpseclib/phpseclib ~2.0 在您的控制器中添加 use phpseclib\Net\SSH2; 然后在控制器方法中使用它,例如: $host = config('ssh.host'); $username = config('ssh.username'); $password = config('ssh.password'); $command = 'php version'; $ssh = new SSH2($host); if (!$ssh->login($username, $password)) { $output ='Login Failed'; } else{ $output = $ssh->exec($command); } 今天pecl install ssh2需要旧版本的php(<=6.0). Here https://pecl.php.net/package/ssh2您可以看到支持php7和php8的最新beta版本的ssh2。所以您应该安装其中之一: pecl install ssh2-1.3.1 * 不要忘记在 php.ini 文件中启用此 ssh2.so 扩展。 我知道有答案,但我只是在这里简化答案。 我有同样的问题,我在 ubuntu 20 中使用以下解决方案修复了它: sudo apt-get install libssh2-1 php7.1-ssh2 -y 您可以根据需要更改 php 版本,例如:php7.4-ssh2 参考:https://blog.programster.org/ubuntu-16-04-install-php-ssh2-extension 适用于 WHM 面板 菜单 > 服务器配置 > 终端: yum install libssh2-devel -y 菜单 > 软件 > 模块安装程序 PHP PECL 管理点击 ssh2 立即安装点击 菜单 > 重新启动服务 > HTTP 服务器 (Apache) 您确定要重新启动此服务吗? 是的 ssh2_connect() 工作了! 我觉得这个已有 11 年历史的讨论值得更新。我从 PHPSecLib 库切换到 PHP 7 和 8 的内置 SSH2 库,因为它似乎连接速度更快并且更标准。现在它还可以使用密钥密码,因此无需再使用第 3 方库。


© www.soinside.com 2019 - 2024. All rights reserved.