我希望sealert
在我的 Debian 环境中使用。
我找不到要安装的软件包和源代码。
我有两个 nginx 容器正在运行。
一个正在侦听端口 80,另一个正在侦听 8080。
这是我运行它们的方式:
sudo podman run --rm \
-t \
-p 8080:80 \
--publish-all \
--name nginx-two \
-v ./html2/:/usr/share/nginx/html \
-v ./html2/conf/default.conf:/etc/nginx/conf.d/default.conf \
-d nginx
第二:
sudo podman run --rm -t -p 80:80 --name nginx -v ./html/:/usr/share/nginx/html -v ./html/conf/conf.d:/etc/nginx/conf.d -d nginx
NGiNX 配置:
location / {
proxy_pass http://10.88.0.37:8080;
}
我也试过:
location / {
proxy_pass http://127.0.0.1:8080;
}
此配置由--name=nginx
容器使用。
这是我得到的错误:
2020/01/26 15:33:05 [error] 8#8: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.88.0.1, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8080/", host: "localhost"
10.88.0.1 - - [26/Jan/2020:15:33:05 +0000] "GET / HTTP/1.1" 502 157 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0" "-"
有没有办法让这些容器相互通信?
我也尝试使用--pod
. 但后来得到这个错误:
Error: cannot set port bindings on an existing container network namespace
我确信这被问了一百万次,但由于某种原因我在网上找不到任何东西。
我有两个使用 Podman 创建的网络(类似于 Docker)。
当我做 localhost:9998 它只是超时。
所以它只是无法连接。
有没有办法创建网桥,以便我可以在特定的容器网络中卷曲我的容器?
更新
[
{
"cniVersion": "0.4.0",
"name": "search",
"plugins": [
{
"bridge": "cni-podman0",
"ipMasq": true,
"ipam": {
"ranges": [
[
{
"gateway": "10.89.0.1",
"subnet": "10.89.0.0/24"
}
]
],
"routes": [
{
"dst": "0.0.0.0/0"
}
],
"type": "host-local"
},
"isGateway": true,
"type": "bridge"
},
{
"capabilities": {
"portMappings": true
},
"type": "portmap"
},
{
"backend": "iptables",
"type": "firewall"
}
]
}
]
我知道在 Docker 中,如果你想改变你去的运行时:/etc/docker/daemon.json
并修改:
{
"runtimes": {
"runnc": {
"path": "/usr/sbin/runnc"
}
}
}
但是我如何使用 Podman 来做到这一点(或者只是添加运行时)?
OCIRuntime:包:
运行:/usr/sbin/运行
路径:/usr/sbin/runc
安装时:
sudo apt-get install \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
我正进入(状态:
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
我发现其他人也有类似的问题:apt-get update mdadm 可怕的警告
所以我按照说明进行操作:
/usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf
然后:
update-initramfs -u
但输出是:
update-initramfs: Generating /boot/initrd.img-4.10.0-30-generic
W: mdadm: /etc/mdadm/mdadm.conf defines no arrays.
lsb_release -a
LSB Version: core-9.20160110ubuntu5-amd64:core-9.20160110ubuntu5-noarch:security-9.20160110ubuntu5-amd64:security-9.20160110ubuntu5-noarch
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
vim /etc/mdadm/mdadm.conf
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#
# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers
# automatically tag new arrays as belonging to the local system
HOMEHOST <system>
# instruct the monitoring daemon where to send mail alerts
MAILADDR root
# definitions of existing MD arrays
# This configuration was auto-generated on Thu, 10 Aug 2017 15:23:15 +0000 by mkconf
/etc/fstab
LABEL=cloudimg-rootfs / ext4 defaults 0 0
/var/swap.1 swap swap defaults 0 0
我认为这在我添加后开始发生:
/var/swap.1 swap swap defaults 0 0
还有什么我需要做的吗?
我在 Vagrant 的帮助下运行虚拟机。
更新 1
我发现了另一个与我类似的问题”:https ://askubuntu.com/questions/834903/i-dont-have-a-raid-but-get-the-warning-mdadm-conf-defines-no-arrays
我补充说:
ARRAY <ignore> devices=/dev/sda1
我在最后加了 1,因为我没有/dev/sda
独立的。
Filesystem Size Used Avail Use% Mounted on
udev 473M 0 473M 0% /dev
tmpfs 97M 3.1M 94M 4% /run
/dev/sda1 19G 4.8G 15G 26% /
tmpfs 483M 0 483M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 483M 0 483M 0% /sys/fs/cgroup
vagrant_ 384G 48G 337G 13% /vagrant
vagrant_www_ 384G 48G 337G 13% /vagrant/www
tmpfs 97M 0 97M 0% /run/user/1000
我这样做对吗?这是做什么的?
警告已经消失了。
这是我设置交换的方式:
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1MB count="1000"
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
每次我重新启动/重新启动交换都消失了。
该命令free
给了我零交换。但是文件/var/swap.1
还在。
swap.1
文件详情:
-rw-r--r-- 1 root root 989000000 Aug 9 20:55 swap.1
989000000这个数字似乎有点大......
我怎样才能让它持久?
lsb_release -a
LSB Version: core-9.20160110ubuntu5-amd64:core-9.20160110ubuntu5-noarch:security-9.20160110ubuntu5-amd64:security-9.20160110ubuntu5-noarch
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
当我做:
apt-get update -qq -y
我收到此错误:
W: Invalid 'Date' entry in Release file /var/lib/apt/lists/osquery-packages.s3.amazonaws.com_xenial_dists_xenial_Release
操作系统详细信息:
没有可用的 LSB 模块。
经销商编号:Ubuntu
说明:Ubuntu 16.04.2 LTS
发布时间:16.04
代号:xenial
我对 osquery 遵循的说明:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1484120AC4E9F8A1A577AEEE97A80C63C9D8B80B
add-apt-repository "deb [arch=amd64] https://osquery-packages.s3.amazonaws.com/xenial xenial main"
apt-get update -qq -y
apt-get install --no-install-recommends --no-install-suggests --force-yes -y -q \
osquery
更新:
做了一些测试。它与此无关:
export TIMEZONE=UTC
cp /usr/share/zoneinfo/${TIMEZONE} /etc/localtime
echo "${TIMEZONE}" | tee /etc/timezone
dpkg-reconfigure --frontend noninteractive tzdata
更新 2
内部/var/lib/apt/lists/osquery-packages.s3.amazonaws.com_xenial_dists_xenial_Release
:
Origin: osquery-builder
Label: osquery-builder
Suite: xenial
Codename: xenial
Date: Fri, 10 Feb 2017 15:02:17 -0800
Components: main
Architectures: amd64
我正在设置一个只能由我的 OpenVPN 用户访问的私有 DNS 服务器。OpenVPN 是在我的 Ubuntu 14 服务器的 tun0 接口上设置的。
问题是我遇到了一些错误。我不确定如何解决它们。我也不确定是否正确配置了我的 BIND9 服务器。
这是我测试配置时得到的结果:
命名检查配置:
没有什么...
命名检查区 one.example.com db.one.example.com:
db.one.example.com:17: 忽略区域外数据 (jeannicolas.com.air.jn) zone one.example.com/IN: 加载串行 3 OK
命名检查区 8.10.in-addr.arpa /etc/bind/zones/db.10.8:
dns_rdata_fromtext:/etc/bind/zones/db.10.8:6:接近 eol:输入区域 8.10.in-addr.arpa/IN 的意外结束:从主文件 /etc/bind/zones/db.10.8 加载失败:意外输入区域 8.10.in-addr.arpa/IN 结束:由于错误未加载。
OpenVPN 的 ifconfig 详细信息:
tun0
链路封装:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 PtP:10.8.0.2 掩码: 255.255.255.255 UP POINTOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX 数据包:3646 错误:0 丢弃:0 超限:0 帧:0 TX 数据包:3957 错误:0 丢弃:0 超限:0 运营商:0 冲突:0 txqueuelen :100 RX 字节:476530 (476.5 KB) TX 字节:2238555 (2.2 MB)
命名.conf.local
zone "one.example.com" {
type master;
file "/etc/bind/zones/db.one.example.com"; # zone file path
# allow-transfer { 10.128.20.12; }; # ns2 private IP address - secondary
};
zone "8.10.in-addr.arpa" {
type master;
file "/etc/bind/zones/db.10.8"; # 10.8.0/24 subnet
# allow-transfer { 10.128.20.12; }; # ns2 private IP address - secondary
};
zone "jn." {
type master;
file "/etc/bind/db.jn";
};
命名.conf.options
acl "trusted" {
# 127.0.0.1;
10.8.0/24;
# 10.8.1.0/24;
};
options {
directory "/var/cache/bind";
recursion yes; # enables resursive queries
allow-recursion { trusted; }; # allows recursive queries from "trusted" clients
# listen-on { 127.0.0.1; }; # ns1 private IP address - listen on private network only
listen-on { 10.8.0/24 };
allow-transfer { none; }; # disable zone transfers by default
forwarders {
8.8.8.8;
8.8.4.4;
};
};
db.10.8
$TTL 604800
@ IN SOA one.example.com. admin.one.example.com. (
3 ; Serial
604800 ; Refresh
2419200 ; Retry
604800 ) ; Negative Cache TTL
; name servers
IN NS ns1.one.example.com.
; PTR Records
3.0 IN PTR ns1.one.example.com. ; 10.8.0.3
db.one.example.com
$TTL 604800
@ IN SOA ns1.one.example.com. admin.one.example.com. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ; Negative Cache TTL
)
;
; name servers - NS records
IN NS ns1.one.example.com.
; name servers - A records
ns1.one.example.com. IN A 10.8.0.3
; 10.8.0.0/16 - A records
jeannicolas.com.air.jn. IN A 10.8.0.100
数据库.jn
;
; BIND data file for TLD ".jn"
;
$TTL 604800
@ IN SOA jn. root.jn. (
3 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS ns1.jn.
@ IN A 10.8.0.100
无法在 Ubuntu 15 上启动 osquery:
我在日志中得到了这个:
● osqueryd.service - LSB: run osqueryd daemon Loaded: loaded
(/etc/init.d/osqueryd) Active: failed (Result: exit-code) since Tue
2015-08-18 05:15:09 UTC; 8s ago
Docs: man:systemd-sysv-generator(8) Process: 27710 ExecStart=/etc/init.d/osqueryd start (code=exited, status=127)
Aug 18 05:15:09 public-server-01 systemd[1]: Starting LSB: run osqueryd daemon...
Aug 18 05:15:09 public-server-01 osqueryd[27710]: osqueryd: error while loading shared libraries: libgcrypt.so.11: cannot open shared object file: No such file or directory
Aug 18 05:15:09 public-server-01 systemd[1]: osqueryd.service: control process exited, code=exited status=127
Aug 18 05:15:09 public-server-01 systemd[1]: Failed to start LSB: run osqueryd daemon.
Aug 18 05:15:09 public-server-01 systemd[1]: Unit osqueryd.service entered failed state.
Aug 18 05:15:09 public-server-01 systemd[1]: osqueryd.service failed.
这就是我安装它的方式:
dpkg -i osquery-latest.deb
apt-get install osquery
那么为什么不启动呢?
有没有办法在我的服务器上查看正在运行的 cron 作业列表?
我想查看正在加载的文件或命令的名称。加上它运行了多长时间。
我在 CentOS 上。
我正在尝试在 CentOS 7 上安装 Varnish 4。
我首先添加了这些 rpm:
sudo rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/jemalloc-3.6.0-1.el6.x86_64.rpm
sudo rpm -iUvh http://195.220.108.108/linux/centos/7.0.1406/extras/x86_64/Packages/epel-release-7-2.noarch.rpm
yum install varnish
但我明白了:
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.team-cymru.org
* epel: mirror.steadfast.net
* extras: mirror.team-cymru.org
* updates: mirror.team-cymru.org
Resolving Dependencies
--> Running transaction check
---> Package varnish.x86_64 0:4.0.2-1.el6 will be installed
--> Processing Dependency: varnish-libs = 4.0.2-1.el6 for package: varnish-4.0.2-1.el6.x86_64
--> Processing Dependency: libvarnishapi.so.1(LIBVARNISHAPI_1.3)(64bit) for package: varnish-4.0.2-1.el6.x86_64
--> Processing Dependency: libvarnishapi.so.1(LIBVARNISHAPI_1.2)(64bit) for package: varnish-4.0.2-1.el6.x86_64
--> Processing Dependency: libvarnishapi.so.1(LIBVARNISHAPI_1.0)(64bit) for package: varnish-4.0.2-1.el6.x86_64
--> Processing Dependency: libvarnishapi.so.1(LIBVARNISHAPI_1.1)(64bit) for package: varnish-4.0.2-1.el6.x86_64
--> Processing Dependency: libvarnishapi.so.1()(64bit) for package: varnish-4.0.2-1.el6.x86_64
--> Processing Dependency: libpcre.so.0()(64bit) for package: varnish-4.0.2-1.el6.x86_64
--> Processing Dependency: libvcc.so()(64bit) for package: varnish-4.0.2-1.el6.x86_64
--> Processing Dependency: libvarnishcompat.so()(64bit) for package: varnish-4.0.2-1.el6.x86_64
--> Processing Dependency: libvarnish.so()(64bit) for package: varnish-4.0.2-1.el6.x86_64
--> Processing Dependency: libvgz.so()(64bit) for package: varnish-4.0.2-1.el6.x86_64
--> Running transaction check
---> Package varnish.x86_64 0:4.0.2-1.el6 will be installed
--> Processing Dependency: libpcre.so.0()(64bit) for package: varnish-4.0.2-1.el6.x86_64
---> Package varnish-libs.x86_64 0:4.0.2-1.el6 will be installed
--> Processing Dependency: libpcre.so.0()(64bit) for package: varnish-libs-4.0.2-1.el6.x86_64
--> Finished Dependency Resolution
Error: Package: varnish-libs-4.0.2-1.el6.x86_64 (varnish-4.0)
Requires: libpcre.so.0()(64bit)
Available: varnish-4.0.0-0.20131129tp1.el6.x86_64 (varnish-4.0)
libpcre.so.0()(64bit)
Available: varnish-4.0.0-0.20140328beta1.el6.x86_64 (varnish-4.0)
libpcre.so.0()(64bit)
Available: varnish-4.0.0-1.el6.x86_64 (varnish-4.0)
libpcre.so.0()(64bit)
Available: varnish-libs-4.0.0-0.20131129tp1.el6.x86_64 (varnish-4.0)
libpcre.so.0()(64bit)
Available: varnish-libs-4.0.0-0.20140328beta1.el6.x86_64 (varnish-4.0)
libpcre.so.0()(64bit)
Available: varnish-libs-4.0.0-1.el6.x86_64 (varnish-4.0)
libpcre.so.0()(64bit)
Available: varnish-4.0.1-1.el6.x86_64 (varnish-4.0)
Not found
Available: varnish-4.0.1-2.el7.x86_64 (epel)
Not found
Installing: varnish-4.0.2-1.el6.x86_64 (varnish-4.0)
Not found
Available: varnish-libs-4.0.1-1.el6.x86_64 (varnish-4.0)
Not found
Available: varnish-libs-4.0.1-2.el7.x86_64 (epel)
Not found
Installing: varnish-libs-4.0.2-1.el6.x86_64 (varnish-4.0)
Not found
Error: Package: varnish-4.0.2-1.el6.x86_64 (varnish-4.0)
Requires: libpcre.so.0()(64bit)
Available: varnish-4.0.0-0.20131129tp1.el6.x86_64 (varnish-4.0)
libpcre.so.0()(64bit)
Available: varnish-4.0.0-0.20140328beta1.el6.x86_64 (varnish-4.0)
libpcre.so.0()(64bit)
Available: varnish-4.0.0-1.el6.x86_64 (varnish-4.0)
libpcre.so.0()(64bit)
Available: varnish-libs-4.0.0-0.20131129tp1.el6.x86_64 (varnish-4.0)
libpcre.so.0()(64bit)
Available: varnish-libs-4.0.0-0.20140328beta1.el6.x86_64 (varnish-4.0)
libpcre.so.0()(64bit)
Available: varnish-libs-4.0.0-1.el6.x86_64 (varnish-4.0)
libpcre.so.0()(64bit)
Available: varnish-4.0.1-1.el6.x86_64 (varnish-4.0)
Not found
Available: varnish-4.0.1-2.el7.x86_64 (epel)
Not found
Installing: varnish-4.0.2-1.el6.x86_64 (varnish-4.0)
Not found
Available: varnish-libs-4.0.1-1.el6.x86_64 (varnish-4.0)
Not found
Available: varnish-libs-4.0.1-2.el7.x86_64 (epel)
Not found
Installing: varnish-libs-4.0.2-1.el6.x86_64 (varnish-4.0)
Not found
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
我以前可以使用 apt-get install t1lib-dev 安装 t1lib。
Ubuntu网站说他们仍然有它,但我无法安装它。
即使当我编译 PHP 我得到这个:
配置:错误:您的 t1lib 发行版未正确安装。请重新安装它。
有解决办法吗?
我正在使用 Ubuntu 14.10。
对于工作,我在 CentOS 上使用 Varnish 3,但在家里我在 Ubuntu 14.04 上使用 Varnish 4。
在工作中,我使用这些命令:
Top hits: varnishtop -i rxurl
Top Misses: varnishtop -i txurl
但由于某种原因,它们不能在 Varnish 4 Ubuntu 上运行。
Varnish 4 中这些命令的等价物是什么?
这是我收到的消息:
Undefined symbols for architecture x86_64:
"_iconv_close", referenced from:
_zif_iconv_substr in iconv.o
_zif_iconv_mime_encode in iconv.o
_php_iconv_string in iconv.o
__php_iconv_strlen in iconv.o
__php_iconv_strpos in iconv.o
__php_iconv_mime_decode in iconv.o
_php_iconv_stream_filter_cleanup in iconv.o
...
"_iconv_open", referenced from:
_zif_iconv_substr in iconv.o
_zif_iconv_mime_encode in iconv.o
_php_iconv_string in iconv.o
__php_iconv_strlen in iconv.o
__php_iconv_strpos in iconv.o
__php_iconv_mime_decode in iconv.o
_php_iconv_stream_filter_factory_create in iconv.o
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [sapi/cli/php] Error 1
在使用 Make 进行编译时,我也收到了很多警告。
例如:
zend_operators.c:2171:34: warning:
'finite' is deprecated: first deprecated in OS X 10.9
[-Wdeprecated-declarations]
} else if (dval1 == dval2 && !zend_finite(dval1)) {
zend_compile.c:4010:9: warning: assigning
to 'char *' from 'const char *' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
lcname = hash_key->arKey;
^ ~~~~~~~~~~~~~~~
'unsigned char *' converts between pointers to integer types with
different sign [-Wpointer-sign]
sc = YYCURSOR;
^
Zend/zend_ini_scanner.l:479:12: warning: assigning to 'unsigned char *' from
'char *' converts between pointers to integer types with different sign
[-Wpointer-sign]
YYCURSOR = sc;
他们还有很多。
这是我的命令:
./configure --enable-fpm --with-pdo-mysql --with-mcrypt --with-zlib --with-openssl --with-curl
make
我以root身份登录。
以下是更多详细信息:
PHP-5.5.13 Mac OS X 10.9.3
我在 NGiNX 中重写正则表达式时遇到了一些问题。
这是我的配置:
location /wiki/ {
rewrite ^/([^?]*)/([^?]*)(?:\?(.*))? /$1/index.php?title=$2&$3 last;
}
这是主页的 URL://example.com/wiki/en/Main_Page
我有两个问题。
首先,当我访问此 URL 时://example.com/wiki/en
它说该页面不存在。有没有办法强制将 / 添加到 URL 末尾的“en”末尾?因为如果你去 //example.com/wiki/en/ 以 / 结尾
第二个问题:
图像未加载。
这是MediaWiki图像位置的URL://example.com/wiki/en/skins/common/images/图像名称
那么,如果我的正则表达式试图获取图像,有没有办法忽略 URL?
当我通过别名加载静态文件时,它会将整个文件加载到 RAM 中,然后将其发送给用户还是直接流式传输给用户?
我在徘徊是因为我有一台具有 250MB RAM 的服务器,并且我在徘徊如果我在 NGiNX 中使用别名来获取 250MB 或更大的静态文件会发生什么。
我正在尝试使用 root 函数打开一个静态文件。这是我的 NGiNX 配置:
location = /test {
root /var/53c74dc1c284ff0d63b019fd736f2c7965939e0452104120130821064016.png;
}
我在浏览器中收到此错误:
404 未找到
此外,它似乎不会在 NGiNX 错误日志中产生任何错误。
我正在使用 Ubuntu 12。
我正在使用 NGiNX 1.2.7 版。
我无法从 NGINX 中的 URL 获取子域。
这是我的配置:
server {
listen 80;
server_name ~^(?<appname>)\.example\.com$;
rewrite ^ https://$appname.example.com$request_uri? permanent;
}
当我做:
http://bob.example.com/
我被送到:
https://.example.com/
我不知道我做错了什么。
我正在使用 NGiNX 1.2.7。
我有另一个配置:
http://example.com/
所以我有一个没有子域的域的服务器块,第二个有子域的服务器块......这是关于子域的。
更新
这里的重定向(这是我试图提取子域的原因):
server {
listen 443 ssl;
server_name ~^(?<appname>)\.example\.com$;
ssl on;
ssl_certificate /etc/ssl/certs/example.com.crt;
ssl_certificate_key /etc/ssl/private/example.key;
root /var/www/example.com/apps/$appname/;
include /var/nginx/general/php;
include /var/nginx/general/upload;
include /var/nginx/general/error_page_50x;
}
新更新
我得到的新错误(这是没有 P):
2013/06/30 00:49:02 [error] 7707#0: *64 directory index of "/var/www/example.com/apps//" is forbidden, client: 00.000.000.00, server: ~^(?<appname>)\.example\.com$, request: "GET / HTTP/1.1 ", host: "ebooks.example.com"
2013/06/30 00:49:02 [error] 7707#0: *64 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 00.000.000.00, server: ~^(?<appname>)\.example\.com $, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "ebooks.example.com"
2013/06/30 00:49:04 [error] 7707#0: *64 directory index of "/var/www/example.com/apps//" is forbidden, client: 00.000.000.00, server: ~^(?<appname>)\.example\.com$, request: "GET / HTTP/1.1 ", host: "ebooks.example.com"
2013/06/30 00:49:04 [error] 7707#0: *64 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 00.000.000.00, server: ~^(?<appname>)\.example\.com $, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "ebooks.example.com"
这是在 ? 之后的 P:
2013/06/30 00:55:57 [error] 17915#0: *74 directory index of "/var/www/example.com/apps//" is forbidden, client: 00.000.000.00, server: ~^(?P<appname>)\.example\.com$, request: "GET / HTTP/1 .1", host: "drive.example.com"
2013/06/30 00:55:57 [error] 17915#0: *74 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 00.000.000.00, server: ~^(?P<appname>)\.example\.c om$, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "drive.example.com"
使用 NGiNX,我得到一个字符串,其中包含我可以使用正则表达式提取内容的信息。
但是我发现我可以做到这一点的唯一方法是使用 if 块。还有别的办法吗?
提取的值需要设置在变量中。
我试图从 Redis 中获取价值。这样我就可以通过变量回显它。这就是我使用 eval 块的原因。但由于某种原因,我收到了错误。
重新加载它们时,我没有收到任何配置错误。
以下是我尝试加载页面后出现的错误 (nginx error.log):
2198 2013/05/15 19:46:00 [info] 18255#0: *22 client timed out (110: Connection timed out) while reading client request line, client: [...] server: [...]
2199 2013/05/15 19:46:00 [info] 18255#0: *23 client timed out (110: Connection timed out) while reading client request line, client: [...], server: [...]
2200 2013/05/15 19:47:40 [info] 18345#0: *28 client timed out (110: Connection timed out) while reading client request line, client: [...], server: [...]
我的配置:
location = /session {
eval $session {
set $laravel "laravel:";
set $redis_key $laravel$cookie_session;
redis_pass [...]:6379;
error_page 404 502 504 = @fallback;
}
echo $cookie_session;
echo ' - ';
echo $session;
}
location @fallback {
echo 'Error!';
}
这是我在谷歌浏览器中得到的:
No data received
Unable to load the webpage because the server sent no data.