Build a custom Docker image using the Apachehttp service's proxy feature

Source: Internet
Author: User
Tags docker run

1, modify httpd.conf

Note characters before the following two lines are removed: #LoadModule proxy_module modules/mod_proxy.so#loadmodule proxy_http_module modules/mod_proxy_http.so

2, adding proxy rules

At the end of the httpd.conf file, add a forwarding rule for example: Proxypass/baidu Http://www.baidu.comProxyPassReverse/baidu http://www.baidu.com will/ Baidu start of the request forwarded to the homepage


3, after the configuration file is changed, create the dockerfile in the sibling directory.

From Httpd:2.4.27copy./my-httpd.conf/usr/local/apache2/conf/httpd.conf

4. Build the Docker image and start the test

#!/bin/bashinstance=zlhttptestimage=zltestdocker rm-f ${instance}docker rmi ${image}docker build-t ${image}. Docker RUN-ITD--name ${instance}-P 8085:80 ${image}


Build a custom Docker image using the Apachehttp service's proxy feature

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.