Articles of nginx

IIS的ASP MVC与Nginx的PHP性能

我想知道什么是asp的mvc性能看起来像与nginx上的php比较。 IIS本身比nginx要求更高。 但是,它开始受益于一定数量的用户吗? 1)假设我有一台机器1.6GHz和1.75GB内存(参数形成Azure上最小的预留托pipe)。 他们会performance相似吗? 将需要多less观众来平衡最初的IIS要求? 2)现在让我们来谈谈eq GoDaddy提供的普通共享主机。 有相同的计划,我将能够服务的用户数量会有显着的差异吗? 当然,我们假设两个应用的function是一样的。 Eq一个大的互联网商店。

为什么这个虚拟主机configuration保持redirect其他域到一个

我正在尝试向nginx添加第二个域。 可以访问domain2.com中的css这样的静态文件,但访问php脚本(例如domain2.com/index.php)将302redirect到domain1.com(例如domain1.com/index.php),所以我认为中断点必须在location ~ \.php$部分,但我不能确定它在哪里。 我被困在这里很长一段时间,我在哪里做错了? [操作系统:Windows 2008; Nginx的:1.0.12] nginx.conf worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; client_max_body_size 50m; gzip on; server { listen 80; server_name _; server_name_in_redirect off; location / { root F:/Web/nginx/html/; index index.html; } } include F:/Web/nginx/vhosts/*.conf; } F:/Web/nginx/vhosts/domain1.com.conf server { listen 80; […]

Nginx重写旧版浏览器

我有以下的configuration文件,除了PHP页面的一切工作。 我试图让所有的东西作为一个古老的浏览器添加/ IE /在URL中。 本质上改变这些客户端的根,尽pipe你不能在一个if中设置它。 如果我在PHP位置添加重写也不起作用。 有任何想法吗? location / { if ($ancient_browser) { rewrite ^(.*)$ /IE/$1 break; } try_files $uri $uri/ /index.php; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_index index.php; if (-f $request_filename) { fastcgi_pass 127.0.0.1:9000; } }

由于scgi_params,Nginx无法parsingconfiguration

我正在尝试安装libtorrent,rtorrent和rutorrent。 我正在安装rutorrent的阶段,他们的wiki说我必须把这个位置块放在我的configuration文件中: location /RPC2 { include scgi_params; scgi_pass unix:/tmp/rpc.sock; } 这是我的这个服务器的整个configuration块: server { listen 80; server_name localhost; access_log /home/whitey/sites/localhost/logs/access.log; error_log /home/whitey/sites/localhost/logs/error.log; root /home/whitey/sites/localhost/htdocs; index index.html index.php /index.php; location / { } location ~ \.php$ { fastcgi_pass unix:/tmp/phpfpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { expires max; } location /RPC2 { include scgi_params; […]

Nginx:不要redirect没有尾随/

我有一个问题,Nginxredirect到错误的url,如果没有尾随/提供。 我有haproxy设置委托多个服务器之间的请求。 curl输出: ➜ ~ curl -i www.ordify.com/register HTTP/1.1 301 Moved Permanently Server: nginx/1.1.19 Date: Tue, 14 Aug 2012 08:10:39 GMT Content-Type: text/html Content-Length: 185 Location: http://www.ordify.com:4000/register/ Connection: close <html> <head><title>301 Moved Permanently</title></head> <body bgcolor="white"> <center><h1>301 Moved Permanently</h1></center> <hr><center>nginx/1.1.19</center> </body> </html> Nginxconfiguration: server { listen *:4000; server_name ordify.com; access_log /var/log/nginx/website-com.log; rewrite_log on; error_page 405 = […]

Ubuntu 12.04在VLAN内打开80端口

我有一个运行在Ubuntu 12.04上的nginx服务器,通过端口80提供http,通过端口443提供https。 一切工作正常,如果我通过本地主机,127.0.0.1或本地IP 192.168.0.11从同一台计算机访问它。 如果我尝试从同一VLAN中的另一台计算机访问服务器,则不适用于http; 它适用于https。 我已经改变了我的nginxconfiguration也听HTTP端口8000; 然后,我可以通过“ http://192.168.0.11:8000 ”从同一个VLAN中的其他计算机访问http。 我也有一台运行在Windows机器80端口上的Web服务器,可以从同一个VLAN中的其他设备访问它,因此路由器不阻止传入的HTTPstream量。 nginx进程由root运行。 我已经使用tcpdump,我看到数据包到达Ubuntu:192.168.0.16.49735> 192.168.0.11.80和一些响应正在给予192.168.0.11.80> 192.168.0.16.49735(我不知道是什么回应是虽然)。 没有请求到达nginx web服务器(我已经检查了访问日志)。 我有iptables空。 我已经很久没有试图find一个解决scheme,现在它已成为一个幸福或辛酸的问题:)。

笨蛋Django通过Nginx的 – configuration文件无限循环重写

我在configurationNginx代替Apache时遇到了一些问题,所以它为客户端提供了Mumble Django服务。 我有vhosts configuration为Apache和Lighttpd – 让我把他们放在这里并排,为您节省点击:)。 Apache2利用WSGI作为CGI运行Django Python。 就我所见,Lighttpd就像Nginx / PHP-FPM一样工作。 专用的Apache2虚拟主机 – configuration: <VirtualHost *:80> ServerName example.com ServerAlias www.example.com Alias /static/admin/ /usr/share/pyshared/django/contrib/admin/static/admin/ Alias /static/ /srv/mumble-django/htdocs/ Alias /mumble/media/ /srv/mumble-django/pyweb/mumble/media/ WSGIScriptAlias / /srv/mumble-django/mumble-django.wsgi WSGIDaemonProcess mumble-django threads=25 WSGIProcessGroup mumble-django WSGIScriptReloading Off # Cache optimization – not necessarily needed for MD, but nice to have 🙂 FileETag None […]

在nginx conf中快速帮助

任何人都可以帮助我的nginx“位置”我想添加这个块到我的nginx conf location / { limit_conn zone_name 8; } 我需要修改位置/folder/index.php?file=x其中x可以是一个string(例如7fe8j) 谢谢

nginx从别名目录访问php时给予404

我正在尝试从apache迁移到nginx。 我托pipe的PHP网站需要访问共享库,这是一个别名目录。 下面是我想出的configuration。 HTML文件工作正常,但PHP文件给404。我已经通读,并尝试了大多数(如果不是全部)的类似问题的答案,没有任何成功。 任何暗示什么可能导致这个问题在我的情况? location /wtlib/ { alias /var/www/shared/wtlib_4/; index index.php; } location ~ /wtlib/.*\.php$ { alias /var/www/shared/wtlib_4/; try_files $uri =404; if ($fastcgi_script_name ~ /wtlib(/.*\.php)$) { set $valid_fastcgi_script_name $1; } fastcgi_pass 127.0.0.1:9013; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/shared/wtlib_4$valid_fastcgi_script_name; fastcgi_param REDIRECT_STATUS 200; include /etc/nginx/fastcgi_params; } 谢谢大家! 更新:以下似乎工作正常: location /wtlib/ { alias /usr/share/php/wtlib_4/; location ~* .*\.php$ { […]

Ruby应用程序Webroot位置

我在工作中inheritance了一个ruby应用程序,我对ruby托pipe环境相当陌生。 该应用程序托pipe在一个Linux服务器上,但我无法findwebroot的位置。 我已经寻找/ var / www这是Apache的Linux的Webroot我已经与其他应用程序的webroot。 但是这个位置在这台服务器上不存在。 我正在浏览服务器上的文件夹,并有一种感觉,它可能是使用Nginx +乘客。 有人能指出我正确的方向在哪里看? 任何帮助是极大的赞赏。