首页 新闻 会员 周边

内网nginx反向代理将http://192.168.10.10/zabbix地址代理成monitor.test.com.cn

0
悬赏园豆:20 [已解决问题] 解决于 2019-10-31 13:03

我想将URL: http://192.168.10.10/zabbix 代理为monitor.test.com.cn; 哪位大哥指定下,nginx官方文档看太懂
我的nginx配置文件如下:

server
{
listen 80;
server_name monitor.test.com.cn;
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.10.10/zabbix;
}
access_log logs/monitor_access.log;
}

龙虚度的主页 龙虚度 | 初学一级 | 园豆:13
提问于:2019-04-17 14:51
< >
分享
最佳答案
0

这是我的配置,可以参考下 server {
listen 80;
server_name localhost;
charset utf-8;
#charset koi8-r;

    #access_log  logs/host.access.log  main;

    # 静态页面目录
    #root       E:\workspace\NBDP-team;
    # 默认首页
    #index      index.html index.htm;
    
    location / {
     # 静态页面目录
    root      E:\workspace\NBDP-team;
    # 默认首页
    index      index.html index.htm;

    #proxy_pass       http://10.226.126.32:8088;
      # 用户浏览器端的缓存设置
      location ~* \.(css|js|jpg|jpeg|gif|png|swf|htm|html|json|xml|svg|woff|ttf|eot|map|ico)$ {
        expires 1h;
        if (-f $request_filename) {
            root       E:\workspace\NBDP-team;
            expires    30d;
            break;
        }
      }
      
      # 动态页面,交给tomcat处理
      if ( !-e $request_filename) {
        proxy_pass       http://10.226.126.32:8088;
      }
      
    }
收获园豆:20
hero~ | 小虾三级 |园豆:513 | 2019-04-18 09:33
其他回答(1)
-1

你可以看我博客,希望对你有帮助

熊泽-学习中的苦与乐 | 园豆:2267 (老鸟四级) | 2019-04-18 09:14
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册