linux中nginx中配置端口轉發

##域名指向主機IP地址,經過域名:8080才能訪問網站,去掉後面的8080;或者其餘的端口號,直接使用域名訪問網站css

<div id="article_content" class="article_content clearfix"> <div class="article-copyright"> <span class="creativecommons"> <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/"></a> <span> 版權聲明:本文爲博主原創文章,遵循<a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank" rel="noopener"> CC 4.0 BY-SA </a>版權協議,轉載請附上原文出處連接和本聲明。 </span> <div class="article-source-link2222"> 轉載原文連接:<a href="https://blog.csdn.net/panshoujia/article/details/91411484">https://blog.csdn.net/panshoujia/article/details/91411484</a> </div> </span> </div> <!--一個博主專欄付費入口--> <!--一個博主專欄付費入口結束--> <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-4a3473df85.css"> <link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-4a3473df85.css"> <div class="htmledit_views" id="content_views"> <p>前期在騰訊雲上購買了域名,並在域名管理中,將域名指向了主機ip地址,tomcat中指定了端口8006未使用默認的8080。</p> <p>這樣就能夠使用域名:8006/項目名稱訪問網站,可是這樣看起來也是泄露了端口號,就想着去掉域名後面的端口號,通過多方查找,發現能夠使用nginx實現端口轉發,其餘的方式暫不知道。</p> <p>首先,</p> <p>1.在linux中安裝nginx,<a href="https://blog.csdn.net/magi1201/article/details/85453025">參照百度的文章</a></p> <p>2.在nginx的conf/nginx.conf中配置參數:</p> <p><img alt="" class="has" src="https://img-blog.csdnimg.cn/20190611093454549.png?x-oss- process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3BhbnNob3VqaWE=,size_16,color_FFFFFF,t_70"></p> <p>3.只須要上面的設置,啓動nginx便可。</p> <p>就能夠使用域名直接訪問網站了。</p> <p>&nbsp;</p> </div> </div>html

相關文章
相關標籤/搜索