nginx简单配置多个域名转向多个tomcat
生活随笔
收集整理的這篇文章主要介紹了
nginx简单配置多个域名转向多个tomcat
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
tomcat的默認端口都是4位,因此訪問時必須再鏈接中加端口,利用nginx可以簡單解決這個問題。
nginx.conf配置:
server {listen 80;server_name xx.com.cn;location / {proxy_set_header X-Real-IP $remote_addr;proxy_pass http://localhost:8080;}}server {listen 80;server_name xx.cn;location / {proxy_set_header X-Real-IP $remote_addr;proxy_pass http://localhost:8180;}}總結
以上是生活随笔為你收集整理的nginx简单配置多个域名转向多个tomcat的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: servlet接收解析json数据
- 下一篇: 怎么样使用TextPad工具,其实没那么