繁体   English   中英

docker容器正在运行但未响应localhost:49153

[英]docker container running but not responding to localhost:49153

我正在使用ubuntu,nginx组件进行POC,下面我提到了Dockerfile

FROM ubuntu:14.04
MAINTAINER Paresh Bhavsar "bhavsar.er@gmail.com"
ENV REFRESHED AT "04-06-2015"
RUN apt-get update 
RUN apt-get -y -q install nginx
RUN mkdir -p /var/www/html
ADD nginx/global.conf /etc/nginx/conf.d/
ADD nginx/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80

nginx.conf文件-

user www-data;
worker_processes 4;
pid /run/nginx.pid;
daemon off;
events { }
http {
  sendfile on;
  tcp_nopush on;
  tcp_nodelay on;
  keepalive_timeout 65;
  types_hash_max_size 2048;
  include /etc/nginx/mime.types;
default_type application/octet-stream;
  access_log /var/log/nginx/access.log;
  error_log /var/log/nginx/error.log;
  gzip on;
  gzip_disable "msie6";
  include /etc/nginx/conf.d/*.conf;
}

global.conf文件

server {
        listen          0.0.0.0:80;
}
root            /var/www/html/website;
index index.html index.htm;

docker容器正在运行,显示如下。

CONTAINER ID        IMAGE                      COMMAND             CREATED             STATUS              PORTS                   NAMES
9e32a617896a        pbhavsar211/nginx:latest   "nginx"             15 minutes ago      Up 15 minutes       0.0.0.0:49163->80/tcp   website     

我无法显示页面localhost:49153,也尝试使用IP地址但没有运气。

我在这里想念什么吗? 提前致谢。

我相信根和索引语句必须位于global.conf文件中的服务器标记内,如下所示:

server {
    listen          0.0.0.0:80;
    root            /var/www/html/website;
    index index.html index.htm;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM