AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-92319

Ade's questions

Martin Hope
Ade
Asked: 2024-09-28 16:39:52 +0800 CST

503 响应预取请求,nginx + PHP

  • 5

我有一个由 nginx 提供服务的 PHP 应用程序/网站。当我使用 Google Chrome 浏览网站并打开开发工具网络面板时,我可以看到在导航到新页面 URL 页面之前有一个预取请求,服务器返回代码为 503(不可用)。

CloudFlare 正在被用作代理。

我很担心这些 503 错误。是否需要 nginx 配置才能正确处理预取请求?

显示双重请求的屏幕截图,一个是预取请求 屏幕截图显示了预取请求的响应标头

nginx
  • 1 个回答
  • 237 Views
Martin Hope
Ade
Asked: 2021-05-25 15:26:22 +0800 CST

如何在 Centos PHP 7.2 上安装 PHP-intl

  • 0

我的 PHP 7.2 应用程序出现错误Message: Class 'NumberFormatter' not found

我们正在运行:

  • PHP 7.2.34
  • CentOS Linux 版本 7.9.2009(核心)

我尝试安装 PHP-intl,如果我再试一次,它似乎现在可以正常工作,我得到了这个:

# yum install php72-php-intl
# Package php72-php-intl-7.2.34-4.el7.remi.x86_64 already installed and latest version
# Nothing to do

我已重新加载 Apache,但未加载扩展:

  • php -m没有列出模块。
  • /usr/lib64/php/modules不包含intl.so

通过运行,rpm -ql php72-php-intl我可以看到这些文件已安装:

/etc/opt/remi/php72/php.d/20-intl.ini
/opt/remi/php72/root/usr/lib64/php/modules/intl.so

但是 extension_dir 设置为/usr/lib64/php/modules

为什么要安装到这个其他位置?我怎样才能让它安装到正确的模块目录,或者告诉 PHP 从 /opt/remi/php72/root/usr/lib64/php/modules加载 .so 文件的正确方法是什么?

php7
  • 1 个回答
  • 3534 Views
Martin Hope
Ade
Asked: 2014-05-20 02:33:29 +0800 CST

nginx - 为子目录指定不同的索引文件名

  • 10

我希望网站根目录中的目录索引文件位于子目录中,但我希望它index.html位于子目录中/foobar.html

IE

  • /index.html
  • /foo/bar.html

我也想请求/foo或/foo/或/foo/:anything解决bar.html

  • 为什么我的位置阻止 /foo 不起作用?
  • 如何为 /foo 指定位置块?

这是服务器定义:

server {
  listen  80;
  server_name  domain.tld;
  port_in_redirect off;

  location / {
    # ssl is terminated at our load bal
    if ($http_x_forwarded_proto != 'https') {
      rewrite ^ https://$host$request_uri? permanent;
    }

    root   /usr/share/nginx/mysite/public;
    index  index.html;
    add_header Cache-Control "public max-age=600";
    add_header "X-UA-Compatible" "IE=Edge,chrome=1";
    charset UTF-8;
  }

  # this location doesn't work  <<<<<<<<<<<<<<
  location /foo {
    root  /usr/share/nginx/mysite/public/foo;
    index  bar.html;
  }

  # set expiration of assets to 30d for caching
  location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
    root   /usr/share/nginx/mysite/public;
    expires 30d;
    add_header Cache-Control "public";
    log_not_found off;
  }
}

编辑:我在该服务器块的底部也有以下内容。

error_page  404              /404.html;
location = /404.html {
  root   /usr/share/nginx/www;
}

# redirect server error pages to the static page /50x.html
error_page   500 502 503 504  /50x.html;
location = /50x.html {
  root   /usr/share/nginx/www;
}
nginx
  • 1 个回答
  • 21033 Views
Martin Hope
Ade
Asked: 2013-07-10 08:21:24 +0800 CST

仍然对权限感到困惑 - linux、nginx、php-fpm

  • 7

我已经阅读了我的网站文件/文件夹在 Linux 网络服务器上应具有哪些权限?

但是我仍然卡住了。我的设置是:

  • 拥有构成网站的目录和文件的开发人员用户“ade”
  • 服务器是带有 php-fpm 通过套接字的 nginx:fastcgi_pass unix:/tmp/php5-fpm.sock;
  • 网站包含一个上传目录,在此配置下运行时,该目录必须可由 PHP 写入
  • 我不想将权限设置为 777,显然

我创建了一个webadmin组并向其中添加了“ade”和 nginx:

$ groups ade
ade : ade webadmin

$ groups nginx
nginx : nginx webadmin

我已将站点中所有内容的所有者设置为我和 webadmin 组:chown ade:webadmin *

...如你看到的:

drwxrwxr-x 2 ade webadmin 4096 Jul  3 13:58 logs
drwxrwxr-x 5 ade webadmin 4096 Jul  4 08:35 public
drwxrwxr-x 4 ade webadmin 4096 Jul  3 16:18 system
drwxrwsr-x 2 ade webadmin 4096 Jul  9 16:13 uploads

然而,尽管上传的权限为 775(用户和组的 rwx),nginx 和 php 无法写入该文件夹。只有当我将它设置为 777 时,它才能将图像上传到它。

我在上述规范答案中看到了有关使用的建议,chmod u+w但不明白为什么这是必要的。

nginx
  • 2 个回答
  • 11087 Views
Martin Hope
Ade
Asked: 2012-05-16 03:02:47 +0800 CST

清漆缓存 - 默认 TTL?

  • 24

我发现我可以在我的 VCL 文件中按如下方式在 Varnish 中设置 TTL:

sub vcl_fetch {
    # 1 minute
    set obj.ttl = 1m;
}

但是默认设置是什么(假设后端服务器没有设置缓存控制标头)?

cache varnish ttl
  • 2 个回答
  • 34128 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve