Tag: nginx

Docker(组合)安装nodejs打破了NPM

我需要使用nginx和nodejs的容器,所以我拿nginx容器并安装节点: FROM nginx ENV DEBIAN_FRONTEND noninteractive WORKDIR /usr/src/app VOLUME /usr/src/app RUN apt-get update && \ apt-get install -y apt-utils && \ apt-get install -y –no-install-recommends curl sudo wget nano && \ curl -sL https://deb.nodesource.com/setup_6.x | bash – && \ apt-get install -y nodejs git build-essential && \ whereis npm && \ npm install grunt grunt-cli […]

docker推拉不工作成功login后

我目前正在尝试configurationnexus3作为docker映像的私有registry,nginx充当反向代理。 在NexusDockerProxy(docker proxy),NexusDockerHosted(docker hosted,http port:4444)和NexusDockerGroup(docker group,http port:5555)之间创build了3个Repos,包括托pipe和代理。 nexus使用nginxconfiguration,我们使用自签名证书,并将其添加到nginxconfiguration文件中。 server { proxy_send_timeout 120; proxy_read_timeout 300; proxy_buffering off; tcp_nodelay on; server_tokens off; client_max_body_size 1G; listen 80; server_name server908.int.org.com; location / { rewrite ^(.*) https://server908.int.org.com$1 permanent; } } server { listen 443; server_name server908.int.org.com; keepalive_timeout 60; ssl on; ssl_certificate /etc/ssl/certs/orgnexus.crt; ssl_certificate_key /etc/ssl/certs/orgnexus.key; ssl_ciphers HIGH:!kEDH:!ADH:!MD5:@STRENGTH; ssl_session_cache shared:TLSSSL:16m; ssl_session_timeout 10m; […]

如何使用带有嵌套web根目录的WordPress安装程序的Kalabox?

我一直在努力和失败的一个星期,让Kalabox与一个嵌套的万维网根与WordPress的安装WordPress的工作。 我发现了一些很棒的资源,但是其中很多资源都是用于Drupal的,而且他们似乎并没有转化为WP安装,就像Tandem在这里所写的那样: https : //www.thinktandem.io/blog/2017/ 5月20日/使用-神殿-S-嵌套文档根与- kalabox / 有没有人有快速演练,将工作? 谢谢!

Docker – 具有自定义conf的nginx

当运行docker-compose.yml docker-compose up和下面docker-compose.yml文件时, nginx在启动后立即退出。 当我删除以下行: – ./nginx/config:/etc/nginx/conf.d nginx不会立即退出。 docker-compose.yml version: '3' services: nginx: image: nginx ports: – '8080:80' volumes: – ./nginx/log:/var/log/nginx – ./nginx/config:/etc/nginx/conf.d – ../wordpress:/var/www/wordpress php: image: php:fpm ports: – 9000:9000 mysql: image: mysql ports: – "3306:3306" environment: MYSQL_ROOT_PASSWORD: secret volumes: – ./mysql/data:/var/lib/mysql 我怎样才能让nginx运行一个自定义的/etc/nginx/conf.d/default.conf ?

docker工人你好世界

我试图让我的应用程序dockerize,因为我一直在官方openresty dockerfile 。 在我的系统中的操作系统是Ubuntu 16.04 64位。 我已经使用这个CMD拉图像。 docker pull openresty/openresty:1.11.2.3-xenial 现在我想使用这个图像,并希望使简单的Hello World应用程序。 为此,我创build了我的工作目录,创build一个自定义的dockerfile,并用它来构build我的自定义图像。 最后我运行这个图像。 以下是我的dockerfile内容。 FROM openresty/openresty:1.11.2.3-xenial EXPOSE 8080 CMD nginx -p `pwd` -c nginx.conf nginx.conf worker_processes 1; error_log stderr notice; events { worker_connections 1024; } http { include /usr/local/openresty/nginx/conf/mime.types; server { listen 8888; location / { default_type text/html; content_by_lua_file "app.lua"; } } } app.lua […]

Passenger中错误地设置了$ GEM_HOME和$ GEM_PATH

我正在尝试在Docker容器中使用Passenger(v5.1.4)+ Nginx设置一个rails(v4.2.6)应用程序。 我使用官方ruby2.3.1作为基础的形象。 以下是我的网站nginx文件 server { server_name example.local; listen 4000; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; root /www/app/public; passenger_ruby /usr/local/bin/ruby; try_files $uri @passenger; location @passenger { passenger_enabled on; rails_env development; } … } passenger_pre_start http://0.0.0.0:4000/status; 更多上下文: Ruby二进制文件存在于/usr/local/bin/ruby gem安装在/usr/local/bundle 但是当我启动nginx服务时,出现以下错误 It looks like Bundler could not find a gem. Maybe you didn't install all the gems that this […]

更新之后,不能在docker中运行瓶子中发出请求,但可以ping

我有一个瓶颈应用程序运行在docker上的nginx后面。 今天我遇到了一个非常奇怪的问题。 我通过sudo apt-get upgrade了我的系统(Ubuntu 16.04),我的笔记本电脑冻结了,我不得不手动重新启动它。 当我再次打开它,并通过撰写我的容器,突然,我正在工作的网站无法提出要求。 当我尝试这个: @root.route('/') def index(): r = requests.get('https://google.com') return "blah" 这给我一个错误。 URLError: <urlopen error [Errno 67] request timed out> 但是,这是完全正确的: @root.route('/') def index(): import os hostname = "google.com" #example response = os.system("ping -c 5 " + hostname) return str(response) 我没有改变任何代码。 在更新之前它正在运行100%。 我试图通过docker exec进入容器,并运行python我可以做的 requests.get('https://google.com') 并返回200响应。 我已经试图rm我的容器,并再次build立他们,但没有骰子。 我很迷茫,只是在寻找可能的线索。 我对networking了解不多。 任何帮助,将不胜感激。 […]

为什么Apache是​​Docker容器中的主要Web服务器(对于PHP)

当我查看docker项目时,几乎每个人都在一个容器中使用Apache来提供基于PHP的应用程序。 例如Piwik。 https://github.com/piwik/docker-piwik 是的,大多数设置在Docker容器(通常是Nginx)之前都有某种代理服务器。 只是想知道为什么大多数人在容器中使用Apache,而不是像Nginx这样的更轻量级更现代的服务器。 唯一我能想到的就是Mod-PHP,因为PHP可以直接embedded到Apache中,而Nginx需要php-fpm。 添加php-fpm和Nginx到相同的容器需要更多的工作(必须启动两个服务)。 想知道是否有任何其他的原因Apache似乎更多的是在基于PHP的docker集装箱的标准。

对于jwilder / nginx-proxy大于8kb / 16KB(和2MB)的文件,Laravel POST TokenMismatchException

我在Laravel 5.4中编写应用程序并对其进行docker化。 要在我的主机中使用子域名,我使用jwilder/nginx-proxy反向代理将请求redirect到我的容器。 在我的应用程序允许用户上传文件,但是,当我在我的主机上运行它,并发送POST“multipart / form-data”请求大于8kb的文件,然后laravel返回TokenMismatchException 。 这是我的configuration: 在我使用的Dockerfile FROM php:7.1.5-alpine … ADD ./uploads.php.ini /usr/local/etc/php/conf.d/uploads.ini … CMD … && php artisan serve –host=0.0.0.0 –port=80 在uploads.php.ini我有: file_uploads = On memory_limit = 100M upload_max_filesize = 200M post_max_size =500M max_execution_time = 600 我以这种方式运行jwilder / nginx-proxy: docker pull jwilder/nginx-proxy:alpin docker run -d -p 80:80 -p 443:443 -v /path/on/host/to/my_proxy.conf:/etc/nginx/conf.d/my_proxy.conf:ro -v […]

Docker:Web容器和PHP容器之间的通信

我试图dockerizing项目运行与PHP + Apache的HTTP服务器。 我了解到,我需要一个容器为Apache HTTP服务器和另一个容器为PHP脚本。 我搜查了很多,但仍然不明白这是如何工作的。 我现在知道的是,我应该诉诸于dockernetworking,只要他们在同一个networking,他们应该互相沟通。 我得到的最近的信息是这个,但它使用nginx: https://www.codementor.io/patrickfohjnr/developing-laravel-applications-with-docker-4pwiwqmh4 从原文引用: vhost.conf The vhost.conf file contains standard Nginx configuration that will handle http requests and proxy traffic to our app container on port 9000. Remember from earlier, we named our container app in the Docker Compose file and linked it to the web container; here, we […]