nginx配置代理转发,使得一个端口支持多个项目配置
2017-04-25 21:22
507 查看
由于在项目中需要一个外网端口支持一个maven仓库一个tomcat,但是只有一个端口,没有办法,只能通过nginx代理实现
现在提供nginx的配置如下
server {
listen 8081;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#匹配以nexus的路径跳转maven仓库
location /nexus {
proxy_pass http://127.0.0.1:8082/nexus;
}
#会跳转 tomcat容器
location /xxx {
proxy_pass http://127.0.0.1:8083;
}
#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的配置如下
server {
listen 8081;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
#匹配以nexus的路径跳转maven仓库
location /nexus {
proxy_pass http://127.0.0.1:8082/nexus;
}
#会跳转 tomcat容器
location /xxx {
proxy_pass http://127.0.0.1:8083;
}
#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;
}
相关文章推荐
- 在ubuntu利用nginx反响代理在一个端口下配置多个站点
- nginx多个项目放在不同的tomcat中,共享同一个端口
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- Nginx反向代理一个80端口下配置多个微信项目详解
- tomcat一个端口配置多个项目
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- nginx监听一个端口多域名转发配置
- nginx 同时监听uwsgi服务器两个端口,实现一个服务器运行多个项目
- nginx做代理IP端口转发的安装和部署配置
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- Nginx实现多个站点使用一个端口(配置Nginx的虚拟主机)
- nginx做代理IP端口转发
- 一个tomcat同时部属多个项目并且用不同的端口进行访问
- windows nginx根据请求地址配置反响代理(同一个ng端口)
- 通过一个tomcat端口访问多个tomcat项目 tomcat转发
- 一个tomcat配置多个端口
- nginx tomcat 配置 多个 二级域名 多个项目
- struts2.3.1.2 使用动态方法配置 Action,使得一个Action可以处理多个请求