为了简化出站防火墙规则,我设置了一个外部nginx服务器来代理所有传出stream量。 我想要的是: https://service1.com.example.com – > https://service1.com:443 https://www.service2.com.example.com – > https://www.service2.com:443 https://service3.com.example.com – > http://service3.com:8080 (所有其他的被拒绝) (这里将有30-40个不同的主机,所以我正在寻找相对容易维护的东西。) 这对Nginx可能吗? 还是有一些更适合这个问题的其他代理软件?
我有一个centos 5.3服务器,运行nginx,我试图安装ISPConfig。 这是失败的一点: -bash-3.2# php -q install.php PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/module/msql.so' – /usr/lib64/php/modules/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0 Could not open input file: install.php 这混淆了我,因为我不确定为什么PHP还没有运行。 我正在使用php-fpm,在这种情况下,取代php? php-fpm的状态显示如下: -bash-3.2# service php status php: unrecognized service -bash-3.2# service php-fpm status php-fpm […]
我尝试了几次,并多次尝试修复与独angular兽nginx下面的代码,但它只是没有工作。 所以现在在上次的报告里这里张贴一些更有才华的人可以看到我的错误,其他人也可以从中受益。 我在用着: nginx的 独angular兽 问题是 没有显示502错误(我使用cap deploy:web:禁用任务来编写maintenance.html) 如果nginx正在运行,但独angular兽也不是即时获取502错误页面 nginxconfiguration: upstream unicorn { server unix:/srv/books/shared/tmp/unicorn.sock fail_timeout=0; } server { listen 80 deferred; server_name books.*; client_max_body_size 4G; keepalive_timeout 10; server_tokens off; root /srv/books/public; location / { try_files /system/maintenance.html $uri/index.html $uri @unicorn; } try_files $uri/index.html $uri @unicorn; location @unicorn { error_page 502 /system/maintenance.html; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header […]
我在ELB后面设置了Nginx服务器。 我设置了api.app.com指向一个ELB。 我想知道哪些地址我应该用于远程连接,Nginx设置等。 1)例如,在Nginx中: 我应该怎么做 server { listen 80; #What is the right line here: # server_name <WWW.NAME.COM> OR <ec2-…..compute-1.amazonaws.com> OR <MLB-….amazonaws.com>?; passenger_enabled on; ….. } 2)我将ELB后面的服务器连接到远程Postgres数据库。 在Postgres设置中,我应该打开ELB地址(MLB -… amazonws.com)还是个人EC2 IP?
我想知道是否有可能匹配WordPress的目录和特定的文件在同一个位置,所以目前我有规则只匹配wp-admin目录: ## Restricted Access directory location ^~ /wp-admin/ { auth_basic "Access Denied!"; auth_basic_user_file .users; location ~ \.php$ { fastcgi_pass unix:/var/run/php-fpm/www.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } 我想也匹配wp-login.php文件,但我无法去工作,我已经尝试了以下内容: location ^~ /(wp-admin/|wp-login.php) { …
我碰到这个话题,我想知道是否有一个选项/variables的fastcgi_pass指令来定义不同的Unix域名套接字,即: fastcgi_pass unix:/var/run/php-fpm/www.sock; 会像这样: fastcgi_pass unix:/var/run/php-fpm/$fastcgi_socket; ?
2012/10/26 14:57:49 [error] 14180#0: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 24.0.20.48, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:81/", host: "107.20.184.144" 这是我得到的nginx错误,导致503错误。 不知道该怎么做。 连接()失败(111:连接被拒绝),当连接到上游说使用php-fpm ,但我使用Rails,所以我认为这是一个不同的错误。 任何帮助将不胜感激。 谢谢 编辑 :如果有关系,这台机器似乎有端口81上运行的Apache2。 不知道与Rails有什么关系,但…
日志说,Nginx给坏的网关 *205 connect() failed (111: Connection refused) while connecting to upstream 果然,9000sockets没有打开。 问题是:我不知道如何打开这个端口。 其他问题解决了这个问题的PHP-FPM,build议使用unix套接字。 然而这在这里似乎并不适用,因为php-5.3.3没有php-fpm.conf。 我使用的是5.3。
我在这里运行一个Nginx 1.2.4networking服务器,并且支持我的主机代理防止ddos攻击。 在这个代理背后的缺点是,我需要从额外的头部获得真正的IP信息。 在PHP中,例如,通过执行$_SERVER[HTTP_X_REAL_IP] ,效果很好。 现在在我的主机代理的背后,我有一个非常有效的方法来阻止某些IP的这样做: include /etc/nginx/block.conf并允许/拒绝那里的IP。 但是现在由于代理,Nginx会看到来自1个IP的所有stream量。 有没有一种方法可以让Nginx像X-REAL-IP头一样通过PHP来读取X-REAL-IP ?
我对nginx完全陌生。 我想转发两个子域到我的apache tomcat服务器中的两个应用程序。 当我通过互联网search,我发现重写做转发,但我看不到转发。 正如我从日志中看到的,它陷入了一个无限循环。 这是我的服务器configuration http { upstream tomcat { server tomcat.ip.address:8080; } server { listen 80; server_name sub1.domain.com; location / { proxy_pass http://tomcat/app1 proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect http://tomcat/app1 http://sub1.domain.com; proxy_buffering off; proxy_store off; } } server { listen 80; server_name sub2.domain.com; location / { proxy_pass http://tomcat/demo; proxy_set_header […]