我有一个带有Nginx(0.7.65)和php5-fpm( 由Brian Mercer包装 )的Ubuntu Lucid服务器, 我所有的configuration是默认的,我的网站configuration是这样的(取代了域): server { listen 80; server_name sub.example.com; access_log /data/log/www/sub.example.com/access.log; error_log /data/log/www/sub.example.com/error.log; location / { root /data/www_data/sub.example.com/public; index index.php; } location ~ \.php$ { fastcgi_param SCRIPT_FILENAME /data/www_data/sub.example.com/public$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; include /etc/nginx/fastcgi_params; } } 我有一个index.php与<?php phpinfo(); ?> <?php phpinfo(); ?>在里面。 现在,当我在Chrome浏览器中加载sub.example.com/时,我可以看到phpinfo。 奇怪的是,在我的访问日志中,多个条目是为index.php命中而写的。 对于favico(这不存在)只有一个命中。 看下面的日志。 130.233.178.70 – – [23/Sep/2010:05:00:27 +0000] "GET / HTTP/1.1" […]
我有一个证书validation一个单一的域名( https://www.example.com ),我已经设置nginx使用该证书。 在页面上,我不想链接到我自己的子域(images.example.com)的图像。 我也有一个有效的证书为images.example.com。 如何防止浏览器警告www.example.com上的内容不安全(因为它已加载/images.example.com中的内容)。 我可以以任何方式将我的images.example.com证书添加到nginxconfiguration文件,或者是我唯一的select购买* .example.com证书的选项吗? 我可以将两个证书合并为一个可以识别这两个域名是安全的吗?
我们在fastcgi模式下使用Nginx + PHP,并使用PHP-FPM作为cgi进程pipe理器。 在我们的脚本中,我们使用PDO来连接MySQL,而绝对不是在持久模式下。 但是最近我们发现我们在MySQL中仍然有太多的连接,有什么build议(或者任何可能的原因)?
我想只允许访问我的index.php文件,并阻止所有其他的PHP文件。 但是,我的窗口框有什么作用,给我在Debian麻烦。 # Route all requests for non-existent files to index.php if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; } # Hide all PHP scripts location ~ \.php { rewrite ^/(.*)$ /index.php/$1 last; } # Forward index.php requests to php-fastcgi location ~ ^/index.php { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; } 目标是确保一切都通过索引,所以没有人可以加载任何碰巧可以访问的PHP类。
但是我们没有使用任何持久连接。 为什么有很多空闲的连接? 我们注意到使用'show processlist'命令,时间约为4000-8000秒。 这些连接看起来总是“睡眠”。 我们在fast-cgi模式下使用带有PHP的Nginx,并使用PDO库。 有什么build议么?
将rewrite规则从Apache转换为Nginx似乎并不困难 不过,我想将这项工作自动化,因为我们正计划迁移一些网站。 是否有任何现有的脚本或工具来执行此操作? 如果不是的话,Apache / Nginx协议中是否有一些特殊的特性会使正则expression式转换更难?
所以我有一个网站(我使用nginx)。 我可以连接到https://example.com就好了。 但是,如果我连接到https://www.example.com,那么它说,有关连接的东西是encryption的,但页面上的资源不是。 页面上没有资源(页面完全相同,不pipe它们是否具有“www”)。 我唯一能想到的是,也许不知何故,cookies不encryption? 我怎样才能弄清楚这个问题,我该如何解决这个问题(当然,我首先需要弄清楚这个问题)。
我目前正在尝试在Nginx中设置一个虚拟主机,这样我就可以运行一个wordpress服务器,就像它在不同的域上一样。 我现在遇到的问题是,wordpress服务器,当我去“ http://example-domain.com/blog/ ”时,显示每个链接指向亚马逊主机,“ec2 – – – – * .compute-1.amazonaws.com”。 我想所有这些链接来解决使用“example-domain.com”主机。 我的主要Nginx的conf文件(nginx.conf)是: http { include /etc/nginx/mime.types; default_type application/octet-stream; server_names_hash_bucket_size 64; log_format main '$remote_addr – $remote_user [$time_local] $request ' '"$status" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 2; #gzip on; # Load config files from the /etc/nginx/conf.d directory […]
我的操作系统 Linux版本2.6.26-2-xen-686(Debian 2.6.26-25lenny1)([email protected])(gcc版本4.1.3 20080704(预发行版本)(Debian 4.1.2-25))#1 SMP Fri Sep 17 00:54:08 UTC 2010 在我的VPS上,我需要使用PHP和ruby。 所以我想使用Apache来处理我的PHP网站和Nginx的ruby网站。 并通过Nginx将PHP请求传递给apache; 然后,我需要使Apache绑定到另一个端口,除了80。 我在/etc/ports.conf中添加了“Listen 8080” 并更改了/ etc / sites-enabled / 000-default(从[VirtualHost *:80]到[VirtualHost *:*]) 并改变了我的虚拟主机([VirtualHost *。*]); 然后重新启动apache2 但是当我要求端口8080的时候,它总是把我指向80端口; 我不知道为什么。 (Apache不应该听80,因为我会让Nginx听80); 任何想法?
我正在运行Nginx(EngineX),我正在尝试为希望使用自己的域名服务的用户直接设置CNAME。 我已经得到尽可能设置cname.domain.com => cname.php,它工作正常,但是当我指向一个单独的域到cname.domain.com它指向回到主页。 任何想法/build议/解决scheme,表示赞赏。 干杯, 雅各