docker nginx代理apache

upstream app_lamp {
 server 172.17.0.2:80 weight=1 max_fails=2 fail_timeout=30s;
}
server {
        listen 80;
        server_name localhost;

        location / {
          root /usr/share/nginx/html;
          index index.html index.htm;
        }
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
                root /usr/share/nginx/html;
        }
        location ~ .*\.(php|jsp|cgi)?$
        {
                proxy_pass http://app_lamp;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                #proxy_pass app_lamp;
        }
}

你可能感兴趣的:(docker)