小编sus*_*tus的帖子

nginx log full proxy_pass to log

Given the following location with proxy_pass, I want to log the fully qualified uri.

location ~* ^/?(foo/?.*$) {
    proxy_pass https://www.someserver.com/some-thing-else/$1;
    break;
}
Run Code Online (Sandbox Code Playgroud)

So for example I'd like

https://www.originalserver.com/foo?page=5
Run Code Online (Sandbox Code Playgroud)

to redirect to

https://www.someserver.com/some-thing-else/foo?page=5
Run Code Online (Sandbox Code Playgroud)

which I believed to be working; I think something else later down the chain is dropping the query_string.

So I want to output to the log file exactly what it was passed to. I tried $uri, $proxy_host, and $upstream_addr but I couldn't find anything that would return the …

nginx logging

8
推荐指数
1
解决办法
2万
查看次数

VirtualHost 中的自定义 PHPINIDir 设置影响其他 VirtualHosts

其中一位客户要求为他的网站进行个人 php.ini 配置,因此我将他的 VirtualHost 设置如下:

<VirtualHost *:80>
    DocumentRoot "/home/alex/www.domain.tld"
    ServerName www.domain.tld
    AssignUserID alex alex
    PHPINIDir /home/alex/php.ini
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

客户端在 /home/alex/ 下创建了 php.ini 文件,其中仅包含以下设置:

session.save_path = "/home/alex/.php_sessions/"

完成此操作后,他开始抱怨他看到了其他客户网站生成的所有其他会话文件。

在做了一些基本的故障排除后,我意识到他的 php.ini 设置影响了 httpd-vhosts.conf 中指定的所有网站。

问题是为什么?由于PHPINIDir仅在一个特定的VirtualHost?

freebsd php apache-2.2

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

apache-2.2 ×1

freebsd ×1

logging ×1

nginx ×1

php ×1