我正在运行一个Ubuntu 10.04 nginx服务器,用一个反向代理到apache(运行munin监视)。 这是我的默认Apache站点文件的摘录: <VirtualHost *:8090> ServerAdmin webmaster@localhost DocumentRoot /var/cache/munin/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> 以及我的example.com nginxconfiguration文件的摘录: location /stats { proxy_pass http://127.0.0.1:8090/; proxy_redirect off; 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_buffers 32 4k; } 每当我去到example.com/stats,nginx指向apache通过端口8090,和apache提供了munin网站目录。 它工作很好。 但是如果我想添加另一个域名,例如example.org呢? 我会有另一个nginxconfiguration文件,但我怎么会使Apache的DocumentRoot别的东西? 由于请求是通过本地端口8090从nginx进入apache,apache如何确定请求来自哪个站点以及哪个DocumentRoot /configuration与它一起提供? 我假设我将不得不使用nginx( $host;或$proxy_add_x_forwarded_for;variables?)设置在Apache中的标头…
好的,我的系统pipe理员通常会照顾这个,但是他最近一直很懒散,我不能再等了。 我用PECL来安装PHP的ssh2扩展。 我已经把extension=ssh2.so放在php.ini中,并检查了ssh2.so在extension_dir 。 当我php -m | grep ssh2 php -m | grep ssh2 ,它显示ssh2 。 当我运行这个脚本时: <?php if (function_exists('ssh2_connect')) { echo "true"; } ?> 并从命令行运行它,它是true 。 当我通过networking服务器运行phpinfo() ,我无法在任何地方findssh2 。 当我通过networking服务器运行ssh2_connect() ,它告诉我函数是未定义的。 我的操作系统是CentOS 5.7 PHP版本5.2.14 nginx / 0.7.67 我一直在寻找谷歌,并尝试所有我能find的,但我无法弄清楚。 谁能帮忙? 编辑: 为了让你们更新,Shish是对的。 我find了一个程序php-fpm ,当被调用时,似乎是我正在寻找的。 但是,由于API编号不匹配,无法加载ssh2扩展 Starting php_fpm PHP Warning: PHP Startup: ssh2: Unable to initialize […]
我在nginx上运行了一些虚拟主机,我希望他们每个都有自己的404页面。 每个虚拟主机都有自己的nginx.conf,包含我的全局nginx.conf。 在特定虚拟主机的configuration文件中,我目前无法正常工作,configuration块如下所示: server{ listen 80; server_name www.foo.com; expires 1M; access_log /srv/www/foo/logs/acces.log; error_log /srv/www/foo/logs/error.log; error_page 404 /404.html; location / { root /srv/www/foo/public_html; index index.html; rewrite ^/(.*)/$ /$1 permanent; try_files "${uri}.html" $uri $uri/ =404; } location = /404.html { internal; } } 404'本身就没有问题,但是当404状态代码返回时,将显示默认的nginx 404页面,而不是显示在站点根目录下的自定义页面404.html。 我已经尝试通过文件系统和网站的URI到错误页面的绝对path,我试图把error_page指令放在位置块。 这些都没有工作。 我的怀疑是,问题来自我用来“美化”我的url的重写和try_files组合。
我有SSL的Nginx服务器。 我正在尝试提交SSL证书。 我重新启动Nginx后,我得到的错误: SSL_CTX_use_PrivateKey_file("…/example.com.key") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch) 我发现这个解决scheme 。 但是,我没有使用任何捆绑。 有什么问题在这里是什么问题?
在Windows上使用nginx和php-cgi时,出现上述错误。 这是我的nginxconfiguration: worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80 default; server_name localhost; charset utf-8; root ..\www; index index.php index.html index.htm; error_page 500 502 503 504 /50x.html; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; root ..\www; try_files $uri =404; fastcgi_param SCRIPT_FILENAME […]
我尝试安装nginx。 我曾经lighttpd,但现在我们必须安装nginx。 你能帮我configurationnginx吗? 我用debian 6.我的nginx.conf: user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; gzip_disable "msie6"; ## # […]
我有一个坐在nginx服务器后面的图像大小调整服务器。 在冷高速caching上,两个请求相同文件的客户端可能触发两个resize的作业。 client-01.net GET /resize.do/avatar-1234567890/300×200.png client-02.net GET /resize.do/avatar-1234567890/300×200.png 如果在这种情况下只有其中一个请求可以通过后端(而另一个客户端设置为“暂停”),那将是非常好的。 在清漆,似乎有这样一个function,称为请求合并 。 但是,这似乎是一个光油专用的术语。 Nginx有类似的东西吗?
下面是我的Nginx.conf – #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #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 logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; gzip […]
我正在运行约6-7个月的Nginx / ISPConfig设置。 从来没有一个问题,一切都很顺利。 但我只是注意到,如果浏览到“blab.example.com”,该页面打开其他域上的我的一个WordPress的博客。 无论我使用什么名称的子域名,我随意input的任何“b53ks.example.com”仍然会进入该博客页面。 我有3或4个不同的域名和网站在同一台服务器上。 但是我认为我在某个地方configuration错了,这可能是这个原因。 可以说我有这些域:example-1.com,example-2.com,another-example.com 如果我转到anything.example-1.com或serverfault.example-2.com或google.another-example.com则返回的页面是我在blog.example-1.com博客 注意:我没有在ISPConfig中设置任何子域名。 相反,我使用“添加新网站”来创build一个子域名。
我想知道你是否可以在nginx虚拟configuration文件中有多个'fastcgi_index'…如果你在下面查看我的virtual.conf,你会看到我把home.php放在'index.php'旁边。我的home.php更多或更less我的网站index.php。 我的网站运行正常(如果它运行得更好,我不会看到是否可以做任何调整)与index.php作为'fastcgi_index',但我甚至不知道为什么index.php(除了这很可能是“fastcgi_index”的默认设置),因为我的网站使用home.php而不是index.php。 所以我的问题是…如果我将我当前的'fastcgi_index'(index.php)replace为home.php,我的网站会运行得更好。 或者我可以把这两个'fastcgi_index'如下所述? location ~ \.php$ { root /home/xx/usr/share/nginx/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php **home.php;** fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; include fastcgi.conf;