当前位置:网站首页>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.
边栏推荐
- dsf5.0 弹框点确定没有返回值的问题
- vim的三种模式
- 【机器学习】1单变量线性回归
- Getting Started Doc 06 Adding files to a stream
- Spark源码-任务提交流程之-6-sparkContext初始化
- I217-V在openwrt软路由下大流量断网问题
- Spark source code-task submission process-6.1-sparkContext initialization-create spark driver side execution environment SparkEnv
- spark source code - task submission process - 1-sparkSubmit
- 【Day8】Knowledge about disk and disk partition
- Contextual non-local alignment of full-scale representations
猜你喜欢
![[Day1] (Super detailed steps) Build a soft RAID disk array](/img/40/cda8e5522c2795e03c0d47e8a689f8.png)
[Day1] (Super detailed steps) Build a soft RAID disk array

I/O性能与可靠性

“元宇宙”是个啥?都有哪些大招?
![[Pytorch study notes] 8. How to use WeightedRandomSampler (weight sampler) when the training category is unbalanced data](/img/29/5b44c016bd11f0c0a9110cf513f4e1.png)
[Pytorch study notes] 8. How to use WeightedRandomSampler (weight sampler) when the training category is unbalanced data

【Day1】(超详细步骤)构建软RAID磁盘阵列

Getting Started 04 When a task depends on another task, it needs to be executed in sequence

The problem of redirecting to the home page when visiting a new page in dsf5.0

错误类型:reflection.ReflectionException: Could not set property ‘xxx‘ of ‘class ‘xxx‘ with value ‘xxx‘

Configuration of TensorFlow ObjecDetectionAPI under Anaconda3 of win10 system

如何使用Houdini进行程序化优化?
随机推荐
spark算子-wholeTextFiles算子
Getting Started Document 09 Standalone watch
Unity huatuo 革命性热更系列1.2 huatuo热更环境安装与示例项目
Configuration of TensorFlow ObjecDetectionAPI under Anaconda3 of win10 system
【Machine Learning】1 Univariate Linear Regression
Remembering my first CCF-A conference paper | After six rejections, my paper is finally accepted, yay!
入门文档10 资源映射
Getting Started 05 Using cb() to indicate that the current task is complete
调用TensorFlow Objection Detection API进行目标检测并将检测结果保存至本地
Why can't I add a new hard disk to scan?How to solve?
账号与权限管理
Getting Started Doc 08 Conditional Plugins
spark operator-wholeTextFiles operator
[Pytorch study notes] 8. How to use WeightedRandomSampler (weight sampler) when the training category is unbalanced data
每日一题-三数之和-0716(2)
spark算子-coalesce算子
lvm逻辑卷及磁盘配额
TensorFlow ObjecDetectionAPI在win10系统Anaconda3下的配置
静态路由
UE4美术你有必要了解的数学基础