私信  •  关注

Danila Vershinin

Danila Vershinin 最近创建的主题
Danila Vershinin 最近回复了
5 年前
回复了 Danila Vershinin 创建的主题 » 允许使用Symfony 4和nginx执行index.php之外的其他php脚本

类似 /index.php fastcgi_params 文件,所以:

location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9001;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
    fastcgi_param DOCUMENT_ROOT $realpath_root;
}

一定要放这个 location ~ ^/index\.php(/|$) { 因为regex位置是按配置中的存在顺序匹配的。

6 年前
回复了 Danila Vershinin 创建的主题 » 使用.htaccess或nginx config重写图像规则

尝试:

rewrite ^/(media/catalog/product/cache)/\d+/thumbnail/(\d+x\d+)/[a-z0-9]+/(\S+) /pub/$1/$2/$3;

Regex check .

6 年前
回复了 Danila Vershinin 创建的主题 » 两个在diff端口上运行的服务的nginx proxy_pass配置

如果你 必须 使用命名位置,然后可以使用 error_page 接近下面。

return 惯性导航与制导 未使用 http状态代码和 错误页面 对于设置为命名位置的代码,我们可以将请求转发到这些命名位置:

server {
  server_name example.com;

  listen 80;
  listen [::]:80 ipv6only=on;

  return 301 https://example.com$request_uri;
}

server {
    server_name example.com;

    listen 443 ssl;

    ssl_certificate     /etc/nginx/ssl/example.com.crt;
    ssl_certificate_key /etc/nginx/ssl/example.com.key;

    ...

    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

    error_page 350 = @client;
    error_page 351 = @server;

    location /api/v1/ {
        return 351;
    }

    location / {
        return 350;
    }

    location @client {
        proxy_pass http://client:8081;
    }

    location @server {
        proxy_pass http://server:8080/api/v1/;
    }

}
6 年前
回复了 Danila Vershinin 创建的主题 » 用于nginx的geoip2未布线

没问题。您似乎正在将动态模块复制到现有的nginx安装中。

这个 nginx -V 将显示 configure 编译nginx时使用的命令。因此它不会显示在单独步骤中编译的动态模块的配置选项,也不会显示加载的模块。

只需使用模块的指令。它应该有用。

6 年前
回复了 Danila Vershinin 创建的主题 » varnish+wordpress+nginx-防止没有存储,没有缓存必须重新验证头文件

发送这些头文件的是PHP引擎。

无论何时启动会话,它都会这样做,这显然是基于 Set-Cookie 在场。

确保只有在绝对需要时才启动PHP会话。默认情况下,当响应包含 设置cookie 或“否定” Cache-Control 你们两个都有。

所以摆脱外来的 session_start() 和/或 setcookie() 电话是这里的关键。

您可以找到有关何时发送反缓存头的详细信息。 here .