我们在debian系统上运行nginx作为负载均衡器 nginx version: nginx/1.9.10 built with OpenSSL 1.0.2e 3 Dec 2015 (running with OpenSSL 1.0.2g 1 Mar 2016) 我们在我们的服务器中激活了http2: server { listen 443 ssl http2; …. } 所有请求代理到我们的应用程序服务器。 我们正在logging来自nginx的request_time和upstream_time 。 我们在第13周将我们的iOS混合应用从UIWebView切换到了WKWebView,看看发生了什么: upstream_time保持不变,但随着越来越多的用户将其应用程序更新到新版本,我们的请求时间突然提高。 今天我们决定尝试一下,并停用http2。 我们只从服务器configuration中删除了“http2”这个词: server { listen 443 ssl; …. } 看看发生了什么: 看来http2不是生产准备好的。 我不知道是服务器端还是客户端。 也许即使request_time没有正确logging在nginx里面。 有没有人有关于使用http2与nginx和/或WKWebView的更多信息?
我有以下服务器configuration: server { listen 7777; server_name localhost; rewrite ^/standardlib/(.*)$ /standardlib/src/main/webapp/$1 last; location / { root D:\Projects\gibr; index index.html index.htm; } location /api { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://172.22.90.61:8008; } } 我有以下链接的资源: http://localhost:7777/standardlib/resources/css/standardlib.css 但是这个文件实际上在里面: /standardlib/src/main/webapp/resources/css/standardlib.css 所以我试图重写url: rewrite ^/standardlib/(.*)$ /standardlib/src/main/webapp/$1 last; 但由于某种原因,它不起作用。 我添加日志logging: error_log logs/error.log notice; rewrite_log on; 但错误日志中没有关于重写的信息。 我用regex101检查了正则expression式,似乎正在捕获正确的组。 我究竟做错了什么? […]
我不确定我的术语是否正确,请让我解释一下… 如果我有一个域test.example.com ,我希望能够将/abc映射到运行在端口8080上的该服务器上的应用程序,并将另一个应用程序/def映射到运行在端口8081上的应用程序。 我已经试过用Docker运行的RabbitMQ,并且暴露了端口15672 ,但NGINX不在Docker内部,直接在机器上运行。 docker run -d –hostname rabbitmq –name rabbitmq -p 15672:15672 rabbitmq:3-management 无论是在Docker中运行,还是直接在机器上运行,我认为是无关紧要的,我有一个在端口15672上运行的应用程序,我想映射到location /rabbitmq 我到目前为止尝试过的NGINXconfiguration: server { listen 80; server_name test.example.com; location /rabbitmq { proxy_pass http://127.0.0.1:15672; } } 当去test.example.com/rabbitmq我看到以下内容: 我不知道这是NGINX的页面还是RabbitMQ的页面显示没有find。 打开服务器上的端口15672 ,我可以清楚地看到RabbitMQ 并去:15672/blah这似乎是未find相同的页面,所以它必须得到RabbitMQ。 RabbitMQ正在监听0.0.0.0:15672 ,所以它应该从任何域,主机或IP工作。 那么如何让test.example.com/rabbitmq实际上提供test.example.com/rabbitmq的内容: test.example.com:15672 ?
我有一个服务于Web应用程序的Tomcat服务器,我有一个运行在它前面的Nginx服务器作为反向代理。 作为对我之前的问题( Tomcat服务器背后的nginx反向代理 – 如何阻止直接访问服务器? )的答案,我被build议防火墙的Tomcat实例,但根据我从不同论坛的调查结果,限制Tomcat听本地主机似乎是要走的路。 为了防止Tomcat侦听到其他IP,我在连接器configuration中添加了“address = 127.0.0.1”。 整个连接器块是这样的 – <Connector port="8080" address="127.0.0.1" maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false" maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443" acceptCount="100" disableUploadTimeout="true" proxyName=<FQDN> proxyPort="80"/> 在Nginx服务器中,我有这些线路用于服务器configuration。 server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; server_name <FQDN>; location / { proxy_pass <FQDN>; 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; } } 现在,如果我尝试使用FQDN访问Web应用程序,Chrome会报告ERR_CONNECTION_REFUSED。 […]
我正在尝试在AWS Linux上configurationnginx 。 我可以得到它为一个网站的工作,但是当我尝试添加另一个我不断收到以下错误: nginx: [crit] pread() "/home/ec2-user/public/sites/example.com" failed (21: Is a directory) 这是我的nginx.conf : user nginx; worker_processes auto; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; } http { log_format main '$remote_addr – $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; […]
我想允许客户端在我们的系统上传文件,我希望他们能够上传比nginx中设置的默认主体更大的文件。 所以我在我们的网站configuration中设置了以下内容: client_max_body_size 10m; 到目前为止,这么好,但我真的只需要在一个单一的URL这个更大的身体尺寸; 一个用户POST到。 所以我尝试了以下configuration: location /api/files/ { client_max_body_size 10m; } 但是,这根本不起作用,我在日志中得到以下错误: 2016/04/24 13:52:51 [error] 17853#0:* 1569513客户端打算发送过大的主体:1083334字节,客户端:203.0.113.7,服务器:example.com,请求:“POST / api / files HTTP / 1.1“,主机:”example.com“ 所以我尝试了以下改变: location = /api/files { client_max_body_size 10m; } 但是这只会导致一个不同的错误: 2016/04/24 14:25:50 [error] 19500#0:* 171 open()“/ usr / share / nginx / html / api / files”失败(2:没有这样的文件或目录),客户端:203.0 .113.7,server:example.com,请求:“POST / api […]
我试图重写像下面的url: https://example.com/products/xperia-z5/ to–> https://example.com/xperia-z5/ 但我想在同一时间的urlhttps://example.com/products/是可访问的,没有任何修改,因为它的产品目录。 为了组织的原因,我把我的文件在/ products / file1,file2等。也许我应该使用“别名”,而不是“重写”? 也许我必须改变try_files指令中的某些内容,或者@ extensionless-php位置有问题,我完全困惑。 请指教。 谢谢。 以下是我的server.confconfiguration server { server_name 192.168.10.1; listen 80; root /home/webmaster/example.com/html_public; charset UTF-8; # replace .php extension with trailing slash location @extensionless-php { rewrite ^(.*)/$ $1.php last; rewrite ^(.*[^/])$ $1/ permanent; } location / { try_files $uri $uri/ @extensionless-php; } error_page 404 /404.php; #pass […]
我在Ubuntu 15.10上编译了最新版本的Nginx,并使用它进行安装 dpkg -i nginx_1.9.15-1_amd64.deb 但是,systemd服务脚本没有创build,所以nginx没有运行。 我到底该如何做,以及自编译后安装nginx的正确步骤是什么,以便所有必要的文件都存在并位于正确的位置? 谢谢!
目前我有一个网站,服务了很多混合的内容,我有整个网站下ssl 。 example.com所有的静态内容,如css js和less量我自己的images ,如徽标等 然而,我的平台从外部域cdn.example.net拉了很多图像,只有less量他们的图像,我没有任何访问导致我的网站扔掉混合内容警告。 什么是ssl站点的危险是我有风险的一些用户没有看到所有的内容,因为有浏览器认为它不安全? 我也使用spdy与nginx ,我想保持速度提升有没有什么解决方法,我可以做到这一点?
我移动了我的Django网站和pip3安装Django。 我使用相同的uswgi包装,而不是在服务器#1的安装,它的工作原理。 在服务器#2上,我收到一个400错误的请求。 如果我停止了uwsgi服务器,我从NGINX得到一个502坏的网关,当UWSGI启动时,它在我刷新页面时收到我的请求。 尽pipe如此,该网站并没有显示,从uWSGI / Django只有400个错误的请求页面出现。 任何人都可以帮我解决这个问题吗? 我对Django知之甚less,只是一个系统pipe理员,并且需要对Django网站进行负载均衡。 当我运行UWSGI服务器时,以下是输出的pastebin:pastebin.com/raw/JwssyZst 请帮忙! 问候