由于docker已经做了端口映射,所以直接监听80端口即可

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}


http {
    server {
        listen 80;
        server_name localhost;
        # alias /usr/share/nginx/html;
        location /img/ {
            alias /usr/share/nginx/html/img/;
            try_files $uri $uri/ =404;
            autoindex on;
        }
        location / {
            proxy_set_header Host $http_host;
            proxy_pass http://ip:9000;
        }
    }

    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    #  log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    # access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}