我有Web服务器与Apache2与许多子域上它像domain.com,abc.domain.com,def.domain.com等现在我有一个新的nginx服务器,并希望像apache2设置它,所以testing我创build了configs(/ etc / nginx / sites-available /中的2个文件,并从站点启用/链接到它们),如图所示, domain.config: server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /srv/www/; index index.html index.htm; # Make site accessible from http://localhost/ server_name domain.com; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ […]
我有nginxconfiguration为代理请求: server { listen 80; server_name proxy.mydomain.com; location /proxy { resolver 8.8.8.8; proxy_pass $args/; } } 所以我可以提出这样的要求: http : //proxy.mydomain.com/proxy?http : //www.test.com 我想控制哪个域允许被代理。 如果没有,我不知道该怎么做。
我的服务器有以下规格 CPU: 6 Cores Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz RAM: 32 GB 我有一个nginx + php-fpm的问题。 由于不明原因,他们占用了太多的资源。 即使我重新启动nginx + php-fpm启动过程将使用许多资源。 我的nginxconfiguration如下: user nginx; worker_processes auto; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; worker_rlimit_nofile 300000; events { worker_connections 6000; use epoll; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status […]
我在当前的设置中使用loadbalancer,请求来自IP 10.71.128.13 。 我使用Nginx作为Gunicorn后端的前端。 我想获得访问者的真实IP地址并logging它(而不是负载均衡IP)。 我的nginx.conf: log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; # GET REAL IP set_real_ip_from 10.71.128.12; set_real_ip_from 10.71.128.13; set_real_ip_from 10.71.128.14; real_ip_header X-Forwarded-For; 我的服务器块'example.conf' # HTTPS server { etc…. location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_set_header Host $http_host; proxy_redirect off; proxy_buffering on; } […]
我们正在运行Ubuntu 12.04.2 LTS和nginx 1.4.0和openssl 1.0.1。 我们只是修补openssl来处理CVE-2014-0224漏洞,并重新启动了nginx,但是扫描器仍然认为我们很容易受到CVE-2014-0224的攻击。 扫描仪包括WhiteHat, https ://access.redhat.com/labs/ccsinjectiontest/,以及来自这里的Python脚本: http : //www.tripwire.com/state-of-security/incident-detection/detection-script- for-cve-2014-0224-openssl-cipher-change-spec-injection / 。 任何人都会遇到这样的事情? 我们检查了nginx,它是dynamic链接的,我们确定我们现在安装了正确版本的openssl。 我们已经通过在nist.gov和ubuntu.com和nginx.com张贴。
我有一个以Nginx服务器作为源(一个Media Temple DV服务器,具体)设置的CloudFront分配。 我启用了Access-Control-Allow-Origin: *标题,以便在Firefox中使用字体。 但是,Firefox会为从此CloudFront / Nginx发行版加载的字体引发CORS错误。 我创build了另一个CloudFront发行版,这次以Apache服务器为起点,并设置了Access-Control-Allow-Origin: * 。 Firefox从这个来源显示字体没有问题。 我在这里设置了一个演示页面: http : //kristengrote.com/cors-test/ 当我从每个发行版对同一个字体文件执行curl请求时,两个文件都返回几乎完全相同的标题: Apache Origin Nginx Origin ——————————————————— ——————————————————— HTTP/1.1 200 OK HTTP/1.1 200 OK Server: Apache Server: nginx Content-Type: application/font-woff Content-Type: application/font-woff Content-Length: 25428 Content-Length: 25428 Connection: keep-alive Connection: keep-alive Date: Wed, 11 Jun 2014 23:23:09 GMT Date: Wed, 11 […]
我正在虚拟服务器上运行一个nginx + php-fpm + mysql,这个服务器有8个内核和16G RAM。我的应用程序是一个简单的API提供程序服务器,它根据请求返回从mysql数据库生成的JSON。 数据集很简单,只有几千字节大。 但是,每秒1000k用户的高负载。 简单的请求需要10 sekonds !!! ..这是很长的。 我认为它的MYSQL,导致缓慢的反应。 因为我有一个testing数据库 – 对testing数据库的相同请求需要1sek。 可能是我需要调整我的MySQLconfiguration,使请求更快? 我正在使用mysqli和绑定技术来产生与PHP输出, 这里是我的configuration: /etc/nginx/nginx.conf # For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx; worker_processes 8; error_log /var/log/nginx/error.log; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log info; pid /var/run/nginx.pid; events { […]
我们有一个问题,后端系统需要Content-Type http头的参数是按照一定的顺序。 例如(注意type =“text / xml”的位置): Content-Type: multipart/related; boundary="-=Part.0.57208b0e-3948-44e6-b15a-9bbfa5f0074b=-"; type="text/xml"; start="<0>"; start-info="text/xml" 应该是(注意type =“text / xml”的位置): Content-Type: multipart/related; type="text/xml"; boundary="-=Part.0.57208b0e-3948-44e6-b15a-9bbfa5f0074b=-"; start="<0>"; start-info="text/xml" 我已经find了模块HttpHeadersMoreModule。 我面临的挑战是我需要改变string的顺序,但保留值。 任何build议如何用nginix解决这个问题? 问候,nidkil
我有一个代理服务器(Ubuntu的),可以通过我的全球IP(不具有域)访问。 例如85.45.0.12:6021,这与本地服务器相反。 本地服务器(10.0.0.25)安装tomcat并在tomcat上运行geoserver。 我configuration了我的代理设置,如下所示: server { location /geoserver { proxy_pass http://10.0.0.25:8080; proxy_set_header Host $proxy_host; proxy_set_header X-Real-IP $remote_addr; auth_basic "Restricted"; auth_basic_user_file /var/work/htpasswd; } } 当我发送请求到我的代理这样的http://85.45.0.12:6021/geoserver我可以访问geoserverpipe理面板。 出现“ 限制 ”浏览器loginpopup窗口。 我正在inputhtpasswd用户名和密码。 而另一个浏览器loginpopup窗口出现那个消息“Geoserver领域”。 我inputhtpasswd用户名和密码,但不能正常工作。 我该如何解决问题? 我认为代理设置上缺less一些东西。 如果我不使用nginx代理并直接访问geoserver机器,geoserver领域popup不会出现。
我有一个python jsonrpc服务在端口8082服务器上运行。 我想用php jsonRPCClient达到它。 (并且必须是https) 我的nginx服务器如下所示: server { listen 443; server_name service.mydomain.com; ssl on; ssl_certificate /path/to/crt/domain.crt; ssl_certificate_key /path/to/crt/domain.key; keepalive_timeout 70; access_log /var/log/nginx/domain.access.log; error_log /var/log/nginx/domain.error.log; location / { 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_pass http://127.0.0.1:8082; } } 当我input我的浏览器: https : //service.mydomain.com然后我看到服务的正确结果。 但是,如果我使用php代码来调用它: $rpc = new jsonRPCClient("https://service.mydomain.com"); return $rpc->create_client($client_id); 然后我不能使用它..而从服务日志似乎这次请求永远不会到达服务。 任何想法如何解决这将是非常宝贵的。 谢谢 (ps:密钥是自签名证书,如果它改变了某些东西) […]