The previous few days experimented with the next Nginx configuration reverse proxy server. Although the installation of Nginx is troublesome, but it is very simple to use. But no one in the group has ever used Nginx,apache servers. I decided to use Apache in order to reduce the workload of OPS team.
I remember having an Apache server when I was in college and didn't have any difficulties. And this installation is always installed is not successful, the company's rights management of the machine is very strict, I do not have root authority, no connection outside the network permissions, compile Apache when there are a lot of dependencies can not be, and finally asked Ops team to help the people to fix.
Configure the proxy module. The proxy module of the Apache server is optional and is not added to the reverse proxy module at compile time, but can still be dynamically loaded by modifying the configuration after the compilation is complete. Configuration in conf/httpd.conf, the reverse proxy-related module uncomment is good. It is important to note that Apache does not automatically resolve dependencies if there is a dependency between modules, but instead tells us which module is missing in Error.log.
As for the reverse proxy configuration, also in the httpd.conf, the configuration is very similar to nginx, for my needs, as long as the httpd.conf to add
Listen 8080<virtualhost *:8080> LogLevel error <location/> proxypass http://hostname1:2014 / proxypass http://hostname2:2014/ #ProxyPassReverse http://mywebsite.jamescoyle.net/ </location > </VirtualHost>
It is important to note that a conversion that requires the addition of a/otherwise URL after Port 2014 will cause an error.
After shutting down the service on the hostname1, Apache will route the request to Hostname2, which is consistent with my requirements.
After the reverse proxy has been set up, I still do not understand some of the configuration, such as Proxypassreverse,servername and so on.
Apache Configure reverse proxy Server