Tag: nginx

nginx错误403 – 目录索引被禁止

我正在尝试将docker nginx与docker flask连接起来。 这是我的项目的结构: . ├── storage │ ├── nginx │ │ └── static │ │ └── image.gif └── web └── flask ├── app │ ├── run.py │ └── templates │ └── index.html ├── conf │ ├── nginx-default.conf │ ├── nginx-flask.conf │ └── requirements.txt └── Dockerfile 虽然curl 127.0.0.1:50和curl 127.0.0.1:80/static/image.gif工作正常,当我curl 127.0.0.1时,我得到一个'403禁止'错误。 更具体地说, nginx给出了以下错误: 2016/03/05 17:54:37 [error] […]

docker – 与Nginx合作是行不通的

这是我的docker-compose.yml version: '2' services: nginx: image: nginx:1.11.8-alpine ports: – "8081:80" volumes: – ./code:/usr/share/nginx/html – ./html:/myapp – ./site.conf:/etc/nginx/conf.d/site.conf – ./error.log:/var/log/nginx/error.log – ./nginx.conf:/etc/nginx/nginx.conf 这是site.conf server { listen 8081; index index.html index.php; server_name localhost; error_log /var/log/nginx/error.log; location /html { root /myapp; } } http://nginx-php-docker.local:8081 /这是工作,显示文件index.html里面/代码文件夹 但它不能与http://nginx-php-docker.local:8081 / html一起工作 错误日志是:2017/01/13 08:50:27 [error] 7#7:* 4 open()“/ usr / share / […]

使用Docker实例制作Web服务器 – 什么地方在哪里?

我刚才遇到了Docker,并且一直在做一些研究,但是有一点对我来说还是有点不清楚。 在Docker创build者观看的video中,他将这个工具比作一个集装箱,这样你就可以保证你的堆栈在里面工作正常。 但是我看到很多的容器图像,只是一个单一的部分,即nginx图像或uwsgi图像。 基本上我想运行一个使用python,flask,nginx和uwsgi的web服务器。 它们都是堆栈的一部分,所以它们应该放在一个容器中,还是应该放在自己的容器中? 我也会有一个MySQL服务器,而且这似乎更合乎逻辑地运行在自己的容器中。 如果这是一个意见的问题,表示歉意,但对我来说,感觉就像只有一个正确的方式去做这件事。

docker命令没有运行

我是新来的docker,并试图运行下面的代码,并得到下面的错误。 Nihits-MacBook-Pro:~ nihit$ docker container run –publish 80:80 nginx Unable to find image 'nginx:latest' locally latest: Pulling from library/nginx bc95e04b23c0: Pull complete 110767c6efff: Pull complete f081e0c4df75: Pull complete Digest: sha256:004ac1d5e791e705f12a17c80d7bb1e8f7f01aa7dca7deee6e65a03465392072 Status: Downloaded newer image for nginx:latest docker: Error response from daemon: driver failed programming external connectivity on endpoint gracious_pare (0a28a065694108085e2b7533870d9d84889899baf5d4130c58c49c4736bb6b12): Error starting userland proxy: Bind […]

如何更改与docker一起使用时的nginx端口

我是docker初学者,我做的第一件事是下载nginx,并试图将它挂载到80:80端口,但Apache已经坐在那里。 docker container run –publish 80:80 nginx 和docker container run –publish 3000:3000 nginx 我尝试像3000:3000那样在3000端口上使用它,但它不起作用,而且它也没有logging任何我可以用来作为参考的东西。

如何只在dockernetworking中公开端口?

我有几个应用程序在Dockernetworking中运行,其端口( 4200等)已经暴露。 我还有一个在同一个Dockernetworking中运行的nginx容器,在不同的域名( site1.com , site2.com )的端口80上托pipe这些应用程序。 但现在如果我直接进入应用程序运行的端口( localhost:3000 ),我也可以访问它们。 如何将这些端口仅暴露给nginx容器而不是主机系统?

从foo.website.com到localhost的proxy_pass:在docker上使用nginx的xxxx – 在物理机器上不是localhost

我正在尝试让foo.website.com显示localhost:8181和bar.website.com上显示localhost:3000的内容。 不过,我希望它从泊坞窗盒(其中:8181和:3000显示我想要的)显示本地主机,而不是我的物理机上的本地主机(它们是空白的 – 没有使用)。我使用nginx做到这一点,而nginx的configuration是在我的docker文件。 Gaphite运行在localhost:3000上,graphics浏览器(更好看/标签支持石墨前端)是在localhost:8181 – 都可以正常工作,当我把url直接到我的浏览器。 Graphite的manage.py在localhost:8080上运行,这就是为什么graphics浏览器处于打开状态:8181。 这是我在这里的第一篇文章,我是新来的docker / nginx和networking一般,所以如果我错过信息/不清楚,我会很乐意纠正… nginx settings: server { listen 80; root /opt/graphite/webapp/content; index index.html; location / { # checks for static file, if not found proxy to app try_files \$uri @app; } # The location is where I'm trying to go from location foo.website.com { # This is […]

使用Docker上的Php / Nginx的工艺CMS不能在Document Root之外编写

我试图build立一个使用Php和Nginx的Docker设置的基本Craft CMS的集装箱版本。 工艺似乎无法写入我的Nginx文档根之外的文件夹。 (请参阅底部的更多细节)我使用的是Docker-Compose,这是我目前的Docker-compose.yml: nginx: build: ./compose/nginx/ ports: – 80:80 links: – php volumes_from: – app php: build: ./compose/php/ expose: – 9000 links: – mysql volumes_from: – app app: image: php:7.0-fpm volumes: – ./app:/var/www/html – ./vendors:/var/www command: "true" mysql: image: mysql:latest volumes_from: – data environment: MYSQL_ROOT_PASSWORD: secret MYSQL_DATABASE: project MYSQL_USER: project MYSQL_PASSWORD: project data: image: […]

Kibana 5.5.1后面的一个nginx 1.13代理(dockerized)

目标: 我想在Docker容器中运行麋鹿堆栈。 为了能够通过nginx代理访问ELK栈来绕过服务的各个端口。 Kibana服务(默认端口5601) http://<server>.com:5601 应通过以下地址可达: http://<server>.com/kibana 问题: 问题是,在将server.basePath设置添加到configuration后,无法到达kibana站点。 如果我将Kibana的每个base API调用添加到nginxconfiguration(/ api,/ ui,…),我只能提供服务。 configuration: Kibana的configuration: /opt/kibana/config/kibana.yml 有以下条目: server.host: "0.0.0.0" server.basePath: "/kibana" 其他一切都是默认的 Doku server.basePath # Enables you to specify a path to mount Kibana at if you are running behind a proxy. This only affects # the URLs generated by Kibana, your proxy is expected […]

玩框架exception的CPU负载

最近我们开始使用PlayFramework,并在CPU负载中看到一些不寻常的活动。 机器细节和其他configuration: 32G Machine 12 Cores PlayFramework 2.2.0 java -Xms1024m -Xmx1024m -XX:MaxPermSize=256m -XX:ReservedCodeCacheSize=128m java applications are running within a docker container(Docker version 0.8.0). 有6个播放服务器运行在nginx后面 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 31752 root 20 0 7876m 1.2g 14m S 716 3.8 150:55.28 java 26282 root 20 0 7862m 1.2g 14m […]