当前位置:网站首页>Apache configure reverse proxy
Apache configure reverse proxy
2022-08-05 06:11:00 【MuggleTan】
In order to allow your spring boot project to be directly accessed by the domain name instead of the IP: port number, you need to use a reverse proxy.Access with domain name.Many tutorials on the Internet are for nignx, and I use apache, and I don’t want to change apache to nignx.
1. Enable Apache's proxy module
After making sure Apache is installed, enable Apache's proxy module via a2enmod proxy proxy_balancer proxy_http.
I am using Ubuntu's Apache and the Apache directory structure under centos seems to be a bit different.
2. Modify the configuration file
Switch to the /etc/apache2/sites-enabled directory and open the configuration corresponding to the website that needs to be modified

If not, create a new configuration file. The name of the file is the prefix .conf of the second-level domain name. For example, my domain name is steventan.top.
Then the website corresponding to test.conf is test.steventan.top, which seems to be just a naming habit, and it is not a big problem if it is different. This is mainly for the convenience of management.
ServerName autoclock.steventan.top #Fill in the IP or domain name of the proxy server hereProxyRequests off #off means turn on reverse proxy on means turn on forward proxyProxyPass / http://localhost:8080/ #The proxy website, the one in the middle / must not be missing, if there is less, restart and report an errorProxyPassReverse / http://localhost:8080/ #ProxyPassReverse# RewriteEngine on# RewriteCond %{HTTPS} !=on# RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]ErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined The above configuration is to map the program running on the local port 8080 to the domain name autoclock.steventan.top, which achieves my purpose. The spring boot project running on the server can be accessed directly on the public network through the domain name.
3. Restart apache to take effect configuration
Restart Apache via service apache2 restart to make the configuration file take effect.
边栏推荐
- 【Day1】VMware软件安装
- SSL证书提示过期或者无效,该怎么处理呢?
- [Day5] Soft and hard links File storage, deletion, directory management commands
- Getting Started 03 Distinguish between development and production environments ("hot update" is performed only in the production environment)
- 新一代解析技术——云解析
- UE4美术你有必要了解的数学基础
- 每日一题-三数之和-0716(2)
- I/O性能与可靠性
- IP数据包格式(ICMP协议与ARP协议)
- Blender软件介绍与使用心得
猜你喜欢
随机推荐
通过单总线调用ds18b20的问题
快问快答—腾讯云服务器常见问题解答
Unity3D中的ref、out、Params三种参数的使用
D39_欧拉角与四元数
[Paper Intensive Reading] The relationship between Precision-Recall and ROC curves
Hard Disk Partitioning and Permanent Mounting
Apache配置反向代理
每日一题-二分法
VLAN详解及实验
dsf5.0 弹框点确定没有返回值的问题
Unity中的GetEnumerator 方法及MoveNext、Reset方法
The problem of redirecting to the home page when visiting a new page in dsf5.0
TensorFlow ObjecDetectionAPI在win10系统Anaconda3下的配置
【Day8】RAID Disk Array
IP地址及子网的划分
入门文档05 使用cb()指示当前任务已完成
Getting Started 05 Using cb() to indicate that the current task is complete
腾讯内部技术:《轩辕传奇》服务器架构演变
ROS视频教程
【Day8】 RAID磁盘阵列






![[Day1] (Super detailed steps) Build a soft RAID disk array](/img/40/cda8e5522c2795e03c0d47e8a689f8.png)


