Articles of nginx

用nginx代理的loopback接口正确设置PF

我试图运行我的web服务器和应用程序服务器,这是运行node.js freebsd监狱几个 我有一个网卡( igb0 )与自定义的回送接口( lo666 ),我已经创build了3个别名,这里是我的/etc/rc.conf dumpdev="AUTO" zfs_enable="YES" sshd_enable="YES" local_unbound_enable=yes ifconfig_igb0="inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255" # Custom loopback interface cloned_interfaces="lo666" ifconfig_lo666_alias0="inet 10.6.6.6 netmask 255.255.255.255" ifconfig_lo666_alias1="inet 10.6.6.7 netmask 255.255.255.255" ifconfig_lo666_alias2="inet 10.6.6.8 netmask 255.255.255.255" # Default router defaultrouter="192.168.1.254" 在我的/etc/pf.conf我有这个 ### Interfaces ### ExtIf ="igb0" IntIf ="lo666" ### Hosts ### IP_PUB ="192.168.1.1" IP_JAIL = "{10.6.6.6, 10.6.6.7, […]

在nginx中启用spdy失败spdycheck.org

我试图用nginx 1.6.0启用spdy,但是spdycheck.org给我两个抱怨: 和 我的nginxconfiguration文件是这样的: server { listen 80; listen 443 ssl spdy; server_name 54.201.32.118; ssl_certificate /etc/nginx/ssl/tulio.crt; ssl_certificate_key /etc/nginx/ssl/tulio.key; if ($ssl_protocol = "") { rewrite ^ https://$server_name$request_uri? permanent; } root /usr/share/nginx/html; index index.html index.htm; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. […]

无法连接到大多数电脑的nginx托pipe网站,但我的本地电脑连接好吗?

我运行一个网站(远程)使用nginx和PHP,这已经很长一段时间了。 我最近更改了域名到一个新的名字,现在大多数网页浏览器/个人电脑无法连接到网站。 他们在浏览器中看到“无法连接”types的消息(例如firefox)。 奇怪的是,我可以通过标准的互联网连接到我的家用电脑。 但是当我在同一家庭networking上使用另一台电脑时,连接失败(对于其他IP地址上的其他电脑也是如此)。 据我所知,没有防火墙问题。 ping报告响应和traceroute看起来对我好。 所以这似乎是服务器上的configuration问题。 我已经为新域(通过startssl)创build了一个新的SSL证书,似乎工作正常。 域名将被路由到服务器,就像之前的域名被路由一样。 所以我卡住了.. 任何人都在意在这里协助和testing? 域名是www.ureka.org。 谢谢

Nginx可能的错误( – )在服务器名

以下是Nginx(v 1.2.1)的configuration server { listen 80; server_name aaa.example.com; root /var/www/aaa; } server { listen 80; server_name hello-world.example.com; root /var/www/hello; } 由于第二台服务器的服务器名称包含dash ( – ),因此nginx将始终打开第二台服务器(无论您是转到hello-world.example.com还是aaa.example.com) 我通过将hello-world重命名为helloworld来解决此问题(删除破折号修复了问题)。 这不是Nginx的错误吗?

Nginx别名或重写Horde Groupware ActiveSync URL不会处理rpc.php文件

我试图用Nginxbuild立一个部落群件。 web界面的工作原理,但我没有得到的ActiveSync特定的URL工作。 部落维基解释了如何在这里使用Apache Webserver。 我的问题是,我设置了一个重写(尝试别名)以通过/horde/rpc.php脚本来提供位置/horde/Microsoft-Server-ActiveSync 。 但是用我当前的configuration,nginx重写并返回一个200状态码。 但它看起来像PHP文件没有执行。 如果我直接去/horde/rpc.php它打开login对话框。 所以这似乎是正确的。 首先,我在Google上search这个问题,但找不到一个可行的解决scheme。 所以现在我想问你。 configuration应该允许通过URL /horde/Microsoft-Server-ActiveSync访问ActiveSync部分。 部落的web界面已经可以通过/horde访问。 我的configuration如下所示: 默认的ssl.conf server { listen 443 ssl; ssl on; ssl_certificate /opt/nginx/conf/certs/server.crt; ssl_certificate_key /opt/nginx/conf/certs/server.key; server_name example.com; index index.html index.php; root /var/www; include sites-available/horde.conf; } horde.conf location /horde { rewrite_log on; rewrite ^/horde/Microsoft-Server-ActiveSync(.*)$ /horde/rpc.php$1 last; try_files $uri $uri/ /rampage.php?$args; location ~ \.php$ […]

munin-cron无法复制内容

我最近在我的(基于Fedora12的)服务器上安装了munin。 现在,我想把所有的图表都放在一个静态目录中(应用程序在Django上运行)。 所以,我编辑文件/etc/munin/munin.conf通过设置htmldir作为我的静态文件夹的绝对path。 然后,当我做了一个munin-cron ,我得到了以下错误: This program will easily break if you run it as root as you are trying now. Please run it as user 'nobody'. The correct 'su' command on many systems is 'su – munin –shell=/bin/bash' Aborting. 所以,我改变了用户,并尝试运行与用户一样的munin 。 然后我得到以下错误: [ERROR] Could not copy contents from /etc/munin/static/ to /[path to static file] […]

ngnix代理https请求子文件夹

我们在nginx后面有几个面向外部的web应用程序,像这样: https://app1.mycompany.com – > server1:8080 / app1 https://app2.mycompany.com – > server2:8080 / app2 https://app2.mycompany.com – > server2:8080 / app3 我要求将nginxconfiguration更新为代理使用子文件夹,而我们的系统pipe理员告诉我们,这是不可能在https下,因为请求url本身是encryption的。 我们的系统pipe理员非常有知识和安全意识,他说的是有道理的。 但是,我曾经在联合系统(作为应用程序开发人员),其中https请求子文件夹被代理到单独的应用程序。 有人可以帮我理解什么types的设置是必要的,以达到以下目的: https://www.mycompany.com/app1 – > server1:8080 / app1 https://www.mycompany.com/app2 – > server2:8080 / app2 https://www.mycompany.com/app3 – > server2:8080 / app3

多个站点使用端口而不是域

我有一个没有域的服务器,但我想在那里运行几个网站。 我想用端口来代替域。 我为此端口设置了一个站点,并将应用程序目录设置为根目录,但是现在当我尝试访问http://127.0.0.1:81 ,服务器将我转到http://127.0.0.1:81/magento然后打破我的申请url。 为什么nginx会这样做? 我的这个网站的configuration是: server { listen 81; root /usr/share/nginx/www/magento; location / { index index.html index.php; try_files $uri $uri/ @handler; expires 30d; } location ^~ /app/ { deny all; } location ^~ /includes/ { deny all; } location ^~ /lib/ { deny all; } location ^~ /media/downloadable/ { deny all; } location ^~ […]

nginx – 根据proxy_pass响应更改error_page

是否可以根据上游代理的响应更改回退error_page? upstream serverA { server servera.com; } upstream serverB { server serverb.com; } location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for proxy_set_header Host $host; proxy_pass http://serverA; proxy_intercept_errors on; # if serverA returns 'hard' 404 # IE returns X-HARD-404=true header return 404; # else I would like to fallback to server-b error_page 403 404 500 […]

将URL映射到nginx中的文件

在configuration文件中, location /i/ { root /data/w3; } /data/w3/i/top.gif文件将被发送以响应/i/top.gif请求。 我如何设置它忽略i在文件path? 事实上,我需要将/i/top.gif映射到/data/w3/top.gif 。