我目前正在测试 nginx 并设置了一些虚拟主机,方法是将每个虚拟主机的配置放在名为sites-enabled.
然后我要求 nginx 使用以下命令加载所有这些配置文件:
include C:/nginx/sites-enabled/*.conf;
Run Code Online (Sandbox Code Playgroud)
这是我当前的配置:
http {
server_names_hash_bucket_size 64;
include mime.types;
include C:/nginx/sites-enabled/*.conf;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
root C:/www-root;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
index index.html index.htm index.php;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include …Run Code Online (Sandbox Code Playgroud) 我看到一个奇怪的问题,php.ini如果我php-fpm在启动它时没有明确地将它传递给它,则不会使用它。
这是我正在使用的新贵脚本:
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [016]
pre-start script
mkdir -p /run/php
end script
expect fork
respawn
exec /usr/local/php/sbin/php-fpm --fpm-config /etc/php/php-fpm.conf
Run Code Online (Sandbox Code Playgroud)
如果 PHP 以上述开头,php.ini则永远不会使用my ,即使它在Configuration File (php.ini) Path.
这是来自phpinfo()以下内容的相关部分:
Configuration File (php.ini) Path /etc/php/
Loaded Configuration File (none)
Scan this dir for additional .ini files (none)
Additional .ini files parsed (none)
Run Code Online (Sandbox Code Playgroud)
如果我修改 upstart 脚本的最后一行php-fpm以 php.ini明确指向:
exec /usr/local/php/sbin/php-fpm --fpm-config /etc/php/php-fpm.conf -c /etc/php/php.ini
Run Code Online (Sandbox Code Playgroud)
然后我们看到 …
我在 nginx 1.2.8 上启用了 gzip,但由于某种原因,它没有对任何东西进行 gzip。
Nginx 安装信息:
nginx version: nginx/1.2.8
built by gcc 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx-1.2.8 --with-http_ssl_module --with-http_realip_module --with-http_gzip_static_module --with-pcre --conf-path=/etc/nginx/nginx.conf --add-module=../headers-more-nginx-module-0.19rc1
Run Code Online (Sandbox Code Playgroud)
配置:
user www-user;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
client_max_body_size 10M;
sendfile on;
keepalive_timeout 65;
more_clear_headers "Server";
gzip on;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml;
server {
server_name test.com;
root /www;
index index.php index.html index.htm;
listen 80 …Run Code Online (Sandbox Code Playgroud) 假设我拥有example.com.
然后我创建一个A记录test.example.com到1.1.1.1.
然后我创建一个NS记录test.example.com到ns1.anotherdnshost.com.
在另一个 DNS 主机上,我将A根 ( test.example.com)的记录添加到2.2.2.2.
客户端查询时test.example.com,A会返回哪条记录?哪个是更“主导”的A记录?这样的设置有效吗?