[英]I am trying to configure nginx as proxy server but getting an error while composing docker file
I am trying to configure nginx as proxy server but getting an error. 我正在尝试将Nginx配置为代理服务器,但出现错误。 I have created below file as part of my work.
我在工作中创建了以下文件。
DockerFile DockerFile
FROM nginx:1.10.1-alpine
RUN rm /etc/nginx/conf.d/*
COPY proxy.conf /etc/nginx/conf.d/
Proxy.config Proxy.config
server {
listen 80;
location / {
proxy_pass http://app;
}
}
docker-compose.yml 泊坞窗,compose.yml
version: '2'
services:
app:
build: app
proxy:
build: proxy
ports:
- "80:80"
When I build docker-compose file I am getting following error: 当我构建docker-compose文件时,出现以下错误:
Puja:Docker pujadudhat$ docker-compose build
Building app
Step 1/2 : FROM nginx:1.10.1-alpine
---> 2cd900f340dd
Step 2/2 : COPY index.html /usr/share/nginx/html
---> Using cache
---> 9d105a18fb9d
Successfully built 9d105a18fb9d
Building proxy
Step 1/3 : FROM nginx:1.10.1-alpine
---> 2cd900f340dd
Step 2/3 : RUN rm /etc/nginx/conf.d/*
---> Using cache
---> a4e1efc3f050
Step 3/3 : COPY proxy.conf /etc/nginx/conf.d/
ERROR: Service 'proxy' failed to build: lstat proxy.conf: no such file or directory
I am getting this error "Service 'proxy' failed to build: lstat proxy.conf: no such file or directory. Can anyone help me to solve? Thank you.n 我收到此错误“服务'proxy'无法构建:lstat proxy.conf:没有这样的文件或目录。有人可以帮助我解决吗?谢谢。
Looks like you are missing the proxy.conf in your project where you build the docker container. 看起来您在构建Docker容器的项目中缺少proxy.conf。 It looks like you have it named Proxy.conf and it should be named proxy.conf .
看起来您将其命名为Proxy.conf ,并且应将其命名为proxy.conf 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.