Articles of 亚马逊 EC2

无法连接到EC2实例中的nginx服务器部署

我在EC2实例中运行一个nginx。 当试图连接到公共DNS,我得到“连接超时”的错误。 我运行curl 127.0.0.1 ,它打印nginx主页,所以nginxconfiguration没问题。 我认为我的EC2实例的安全策略出了问题,但我已经设置它允许所有的stream量进出。 谢谢你,伙计们。

http 403错误+“readv()失败(104:连接重置由同级)而读取上游”

前言:我使用s3boto作为默认存储后端在amazon ec2实例上运行nginx + gunicorn + django。 我是免费的。 ec2安全组允许:http,ssh和https。 我试图发送包含单个元素的多部分/表单数据请求:照片。 试图上传照片时,iPhone(来自请求的来源)挂起。 照片大小约为9.5 MB。 当我检查nginx-access.logs时: “POST / myUrl / HTTP / 1.1”400 5“ – ”“…. 当我检查nginx-error.logs时: [error] 5562#0: *1 readv() failed (104: Connection reset by peer) while reading upstream, client: my.ip.addr.iphone, server: default, request: "POST /myUrl/ HTTP/1.1", upstream: "http://127.0.0.1:8000/myUrl/", host: "ec2-my-server-ip-addr.the-location-2.compute.amazonaws.com" [info] 5562#0: *1 client my.ip.addr.iphone closed […]

Dokku端口configuration问题EC2

我目前正在尝试使用Dokku在EC2实例上部署我的应用程序,我的第一印象是它真的很棒。 我仍然有一些问题,我的应用程序的configuration,它可以通过端口80到达,而不是docker的容器端口。 因此,例如,当我尝试达到我的应用程序可以在下面: http://recipeapp.xxx.de:49169/ 但不是 http://recipeapp.xxx.de/ 我的VHOSTconfiguration如下所示: xxx.de 应用程序的nginx.conf生成如下: upstream recipeapp { server 127.0.0.1:49169; } server { listen [::]:80; listen 80; server_name recipeapp.xxx.de; location / { proxy_pass http://recipeapp; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Request-Start $msec; } } 我添加我的远程:git remote […]

nginx:“location”指令在/etc/nginx/conf.d/default.conf:1中是不允许的

我刚刚在AWS AMI实例中使用Nginx,并且遇到了一些启动问题。 我跟着这个链接来安装php-fpm和nginx https://gist.github.com/sumardi/5559803 除了我不需要mysql,所以我没有运行这个命令sudo yum -y install mysql-server mysql 我的/etc/nginx/conf.d/default.conf如下所示: location / { root /var/www/html; index index.php index.html index.htm; } location ~ \.php$ { fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/ html$fastcgi_script_name; include fastcgi_params; } 我的/etc/php-fpm.d/www.conf ; Start a new pool named 'www'. [www] ; The address on which to accept FastCGI requests. ; […]

EC2 Micro Instance只能使用nginx服务器处理多less用户?

我有一个iOS社交应用程序。 这个应用程序与我的服务器进行交谈,经常更新和检索。 大部分小文本为JSON。 有时用户会上传我的web-server上传到S3 Bucket 。 web-server不会检索任何图片或任何其他types的文件 EC2 Micro Ubuntu 13.04实例运行PHP 5.5 , PHP-FPM和NGINX 。 caching由Elastic Cache使用Redis处理,数据库连接到一个单独的m1.large MongoDB服务器。 内容可以相当dynamic,因为新闻源可以是dynamic的。 我是关于configurationNGINX性能的总新手,我想看看我是否已经正确configuration了我的服务器。 我正在使用Siege来testing我的服务器负载,但是我无法find任何types的统计信息,说明我的系统能够处理多less个并发用户/页面负载,以便我知道我已经做了正确或错误的事情。 我的服务器能够处理多less个并发用户/页面加载? 我猜如果我不能从经验中得出统计数据,那么对我的micro instance应该是简单的,中等的和极端的? 我知道还有其他几个问题提出类似的问题。 但是没有一个提供类似的系统的估计,这是我正在寻找的。

Aws路由到不同的ELB

使用aws工具,根据URI将stream量路由到不同的EC2实例的最佳方式是什么? 例如: www.website.com/login – > EC2实例1 www.website.com/backoffice – > EC2实例2 我知道我可以把一个nginx,并通过它路由所有传入的互联网stream量,但有没有更简单的解决scheme?

用一个子域configurationNginx

我做了我以前的研究,但似乎无法find如何正确configurationnginx接受一个子域名。 我目前正确地为mydomain.comconfiguration,但不是analytix.mydomain.com: server { listen 80; server_name *.mydomain.com; access_log /home/ubuntu/virtualenv/mydomain/error/access.log; error_log /home/ubuntu/virtualenv/mydomain/error/error.log warn; connection_pool_size 2048; fastcgi_buffer_size 4K; fastcgi_buffers 64 4k; root /home/ubuntu/virtualenv/mydomain/homelaunch/; location /static/ { alias /home/ubuntu/virtualenv/mydomain/homelaunch/static/; } location / { proxy_pass http://127.0.0.1:8001; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"'; } } server_name声明接受<anythinghere>.mydomain.com这是很好的。 […]

AWS S3静态网站托pipe与CloudFront和目录redirect

我的问题不仅是在S3上托pipe一个静态网站,它还远远不止于此。 我的计划是在S3上有一个www.foo.com。 所以我创build了一个名为www.foo.com的桶,并将域设置为指向那个域。 所以我的每个文件都是公开的,并且是网站的一部分。 但是有一个例外: 每当我导航到www.foo.com/blog ,我想对EC2容器上托pipe的博客进行内部redirect。 通过使用带有proxy_pass定义的Nginx,可以轻松实现这一点。 但S3不是Nginx。 我知道有一些我可以应用的redirect规则,但是我怎么去做一个内部redirect,其中用户的URL是http://www.foo.com/blog,但是博客存储在不同的机器上。

Nginx试图下载文件而不是显示

我安装Nginx,并有一个子域和域。 子域有php5-fpm和wordpress。 它工作正常,并在一个站点可用文件符号链接到网站启用。 该域没有PHP,并有一个文件也符号链接。 即使重新启动服务器,当我去的域名,它试图下载HTML文件。 这是我的站点可用页面的域名: server { server_name www.example.us; rewrite ^(.*) http://example.us$1 permanent; } server { listen 80; server_name example.us; root /var/www/example; index index.php; autoindex on; autoindex_exact_size off; include /etc/nginx/security; # Logging — access_log /var/log/nginx/example.us.access.log; error_log /var/log/nginx/example.us.error.log notice; # serve static files directly location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ { access_log off; expires max; } # location […]

如果您只发送JSON对象,那么适当的NGINXconfiguration是什么?

我是一个iOS开发人员,我的后端都是用Django编写的。 我使用gunicorn作为我的HTTP服务器。 我有三名工人在一个小的EC2实例上运行。 我的iOS应用程序不需要任何图像或静态内容。 最多,我每次发送一次发送1-20个JSON对象。 每个JSON对象最多有大约5-10个字段。 我对NGINX很新。 我听说它可以做代理缓冲。 我想为缓慢的客户端添加代理缓冲,但我不知道适用于以下模块的具体设置: proxy_buffers Syntax: proxy_buffers number size Default: 8 4k|8k Context: http server location Reference: proxy_buffers proxy_busy_buffers_size Syntax: proxy_busy_buffers_size size Default: 8k|16k Context: http server location Reference: proxy_busy_buffers_size proxy_buffer_size Syntax: proxy_buffer_size size Default: 4k|8k Context: http server location Reference: proxy_buffer_size 我知道如何使用的唯一的设置(这是相当悲伤)是以下的一个: proxy_buffering Syntax: proxy_buffering on | off Default: […]