我在自己腾讯云服务器上更改nginx配置的操作指引

时间:2025-11-12 09:23:21 来源:如何通过云服务器搭建邮件系统

摘要 :

1 、自己作我买的腾讯内存数据库腾讯云服务器  ,是云服引安全扫描集成了nginx和mysql等环境的。

我在自己腾讯云服务器上更改nginx配置的操作指引

2、上更依赖分析我需要调整nginx的配置许可证检查配置,本尊科技做我自己的自己作合规审计站点指向

一 、找到nginx的腾讯部署位置

which nginx

发现nginx在这里只是一个启动文件,我需要看看其运行配置

ps -ef | grep nginx

/www/server/nginx/sbin/nginx -c /www/server/nginx/conf/nginx.conf

找到配置文件在

/www/server/nginx/conf/nginx.conf

拷贝nginx.conf文件到本地

"C:\Program Files\PuTTY\pscp.exe" -P 22 root@106.55.226.23:/www/server/nginx/conf/nginx.conf C:\Temps\t

我的初始站点:

http://106.55.226.23:8085/zx-tool-web/

访问验证地址:

http://106.55.226.23:8085/zx-tool-web/ctrl/tool/common/helloWorld

nginx配置期望的访问地址:

http://tool.p23.lookdaima.com:8086/ctrl/tool/common/helloWorld

相关配置 :

server { listen 8086; server_name tool.p23.lookdaima.com; location / { proxy_pass http://localhost:8085/zx-tool-web/; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }

在nginx.conf加上如上配置后,访问

cd /www/server/nginx/sbin/

重启nginx

./nginx -s reload

访问验证 :

成功

推荐内容