我已经configurationnginx使用auth_basic来密码保护一个目录。 密码提示出现,login工作正常。 但是,如果我拒绝键入我的凭据,而是连续多次命中转义,页面将最终加载W / O CSS和图像。 换句话说,连续告诉login提示消失将在某个时候允许页面加载。 这是nginx,或我的configuration问题? 这是我的虚拟主机: 31 server { 32 server_name sub.domain.com; 33 root /www/sub.domain.com/; 34 35 location / { 36 index index.php index.html; 37 root /www/sub.domain.com; 38 auth_basic "Restricted"; 39 auth_basic_user_file /www/auth/sub.domain.com; 40 error_page 404 = /www/404.php; 41 } 42 43 location ~ \.php$ { 44 include /usr/local/nginx/conf/fastcgi_params; 45 } 46 […]
我有一个nginx / logrotate的问题。 问题在于nginx正在logging对2个文件(主数据和数据)的访问。 我有以下反configuration设置:0 * * * * / usr / sbin / logrotate -f / home / orwell / orwell-setup / bin / logrotate-nginx 而“logrotate-nginx”文件有以下内容: /tmp/data.log { rotate 90 daily missingok notifempty size 1 sharedscripts postrotate [ ! -f /tmp/nginx.pid ] || kill -USR1 `cat /tmp/nginx.pid` MORE THINGS endscript } /tmp/main.log { rotate […]
我在运行PHP应用程序的Apache上运行Magento(电子商务PHP应用程序)作为反向代理。 静态内容由nginx直接提供。 Magento有一个使用503 HTTP响应的“维护模式”。 在维护模式启用的情况下,使用我的configuration,nginx返回一个带有500响应的空白页面,而不是带有503响应的Magento良好的维护模式页面。 如何让nginx让503页面传递给客户端? 这是我的nginxconfiguration: 上游examplecluster {server 1.2.3.4:80; } 服务器{ 听1.2.3.5:80; server_name www.example.com; root /var/www/example.com/www; #安全 位置〜(/(app/|includes/|lib/|pkginfo/|var/|report/config.xml|downloader/(pearlib|template|Maged)/)|/\.svn/|/\.ht.+ ){ 返回404; } 位置〜\ .php $ { proxy_pass http:// examplecluster; proxy_redirect默认; } #静态内容 位置 / { try_files $ uri @apache; 到期7天; } #Apache 位置@apache { proxy_pass http:// examplecluster; proxy_redirect默认; } }
从: https : //stackoverflow.com/questions/3748517/does-nginx-upstream-has-a-port-setting 我使用upstream和proxy进行负载平衡。 指令proxy_pass http://upstream_name使用默认端口,即80。 但是,如果上游服务器不侦听此端口,则请求失败。 我如何指定备用端口? 我的configuration: http{ #… upstream myups{ server 192.168.1.100:6666; server 192.168.1.101:9999; } #…. server{ listen 81; #….. location ~ /myapp { proxy_pass http://myups:81/; } } nginx -t: [warn]: upstream "myups" may not have port 81 in /opt/nginx/conf/nginx.conf:78.
我希望Nginx能够做到以下几点: 如果uri匹配模式: http://mysite.com/$string/ 和$string不是'KB',而不是'图像',在特定的子文件夹中查找$ string.html。 如果子文件夹中存在$ string.html,则返回它。 如果不存在,请转到下一个匹配位置。 $ string = {任何字母,数字或短划线} 例如,如果用户请求: http://mysite.com/test/ 它应该寻找一个名为: /webroot/www/myfolder/test.html 我已经尝试过的变体: 位置〜/ [a-zA-Z0-9 \ – ] + / { try_files /myfolder/$uri.html @Nowhere; } 但: 它似乎没有find该文件,即使它确实存在,和 如果失败(现在总是这样),它想要跳转到@nowhere位置,而不是继续前进,并试图find另一个匹配的位置。 如果文件不存在,我想让它考虑当前位置“不匹配”。
我有一个基于Drupal的网站,VPS有1GB内存和1Ghz处理器份额。 networking服务器是nginx以及php-fastcgi。 目前我正在使用10个nginx和13个php-fastcgi进程。 服务器负载大部分时间是高的,而一半的RAM没有被使用。 CPU使用率很less达到80%。 我尝试过一些其他的nginx / php-fastcgi组合,但是我不确定什么是最佳组合,因为我对表面下面发生的事情一无所知。 所以我很感谢你能分享你的经验或给我一些线索。
我检查了两个站点的服务器响应,“服务器:”标题标题完全丢失。 当然这很酷,隐藏你的服务器string,但我仍然好奇它是什么? Apache的? Nginx的? 拜托告诉我!
我正在使用Supervisor,在这个项目中我有一个由Supervisordpipe理的nginx进程。 configuration的相关部分是这样的: [supervisord] logfile=/home/projects/eceee-web/prod/var/log/supervisord.log logfile_maxbytes=5MB logfile_backups=10 loglevel=info pidfile=/home/projects/eceee-web/prod/var/supervisord.pid ; childlogdir=/home/projects/eceee-web/prod/var/log nodaemon=false ; (start in foreground if true;default false) minfds=1024 ; (min. avail startup file descriptors;default 1024) minprocs=200 ; (min. avail process descriptors;default 200) directory=/home/projects/eceee-web/prod [program:nginx] command = /home/projects/eceee-web/prod/bin/nginx redirect_stderr = true autostart= true autorestart = true directory = /home/projects/eceee-web/prod stdout_logfile = /home/projects/eceee-web/prod/var/log/nginx-stdout.log stderr_logfile = /home/projects/eceee-web/prod/var/log/nginx-stderr.log […]
我们在我们的networking服务器上做了大约1000次/秒的处理,并且在到达最终的LAMP堆栈之前有caching和平衡层。 我们有6个Apache(Prefork MPM; 2.2.12)+ PHP(5.3.2)服务器,通用的memcache服务于最后的请求,以防止它的清漆上的打击。 现在我们面临的问题是缩放。 我们对响应时间超级批评,如果后端在一秒钟内不响应,我们的反向代理将从后端断开连接。 随着更多的请求/秒,我们面临越来越多的上游错误,我们的LAMP机器无法承受负载。 我们正在重新思考一个新的服务器架构,现在正在寻找一些不错的select。 没有静态图像/没有涉及静态内容。 到达这些服务器的唯一要求是(3个采集数据,1个sedning数据 – 最大2KBdynamic文件) 我们正在研究Apache(worker MPM)+ PHP CLI nginx + PHP FPM 我想知道是否有好的教程或基准报告,我可以参考,如果有任何其他configuration,我可以给一个镜头 感谢Sparsh Gupta
我在centos 5.6上运行nginx 1.0 。 我有php 5.1.6安装并运行,然后决定卸载它,切换到php 5.3 。 我运行了以下命令: [user@server]$ /etc/init.d/nginx stop [user@server]$ yum remove php php-* [user@server]$ sudo yum install php53-cli php53-common php53-devel php53-gd php53-mbstring php53-mysql php53-soap php53-xml php53-xmlrpc php53-bcmath php53-snmp [user@server]$ /etc/init.d/nginx start 现在,当我在浏览器中查看phpinfo()的输出时,它仍然读取“PHP Version 5.1.6”。 我错过了哪些步骤?