当前位置:论坛首页 > Linux面板 > 求助

【已完成】宝塔nginx转发无效!ip正常访问

发表在 Linux面板2022-7-12 16:21 [复制链接] 8 9743

# www.superxiang.com转发到9001端口
    server {
        listen 80;
        server_name www.superxiang.com;
        rewrite ^(.*) https://$server_name$1 permanent;
        index index.php index.html index.htm;
        location / {
            proxy_pass http://localhost:9001;
        }
    }
    # code.superxiang.com转发到9001端口
    server {
        listen 80;
        server_name code.superxiang.com;
        # rewrite ^(.*) https://$server_name$1 permanent;
        index index.php index.html index.htm;

        location / {
            proxy_pass http://localhost:9001;
        }
    }
    # www.niubaide.cn转发到9001端口
    server {
        listen 80;
        server_name www.niubaide.cn;
        index index.php index.html index.htm;

        location / {
            proxy_pass http://localhost:9001;
        }
    }

    # img.superxiang.com转发到9002端口
    server {
        listen 80;
        server_name img.superxiang.com;
        rewrite ^(.*) https://$server_name$1 permanent;
        index index.php index.html index.htm;

        location / {
            proxy_pass http://localhost:9002;
        }
    }
    # blog.superxiang.com转发到9002端口
    server {
        listen 80;
        server_name blog.superxiang.com;
        rewrite ^(.*) https://$server_name$1 permanent;
        index index.php index.html index.htm;

        location / {
            proxy_pass http://localhost:9003;
        }
    }

    # web.niubaide.com转发到5001端口
    server {
        listen 80;
        server_name web.niubaide.com;
        index index.php index.html index.htm;

        location / {
            proxy_pass http://localhost:5001;
        }
    }
    # im.niubaide.com转发到5001端口
    server {
        listen 80;
        server_name im.superxiang.com;
        index index.php index.html index.htm;

        location / {
            proxy_pass http://localhost:5001;
        }
    }


配置文件如下,只有im.superxiang.com端口运行有问题,其他项目端口+ip都是能正常访问的,没有防火墙,面板内防火墙也关了,只用了腾讯云的端口安全组管理,相关的端口都是放开的,想请问是什么问题?

使用道具 举报 只看该作者 回复
发表于 2022-7-12 16:40:23 | 显示全部楼层
你的这个配置加哪里了?重启nginx有报错吗?尝试过使用面板--网站--反向代理去实现你的这个需求吗?
使用道具 举报 回复 支持 反对
发表于 2022-7-13 09:46:29 | 显示全部楼层
大炮运维V587 发表于 2022-7-12 16:40
你的这个配置加哪里了?重启nginx有报错吗?尝试过使用面板--网站--反向代理去实现你的这个需求吗? ...

有的,这个问题最后排查是发现配置内强制跳转了https,但是我后来又给重置了,但是重新安装了宝塔之后我的app插件没了,之前是领了三年的,现在如何恢复购买啊?
使用道具 举报 回复 支持 反对
发表于 2022-7-13 11:55:00 | 显示全部楼层
1636602537nwuu 发表于 2022-7-13 09:46
有的,这个问题最后排查是发现配置内强制跳转了https,但是我后来又给重置了,但是重新安装了宝塔之后我 ...

您ip变化了吗?
使用道具 举报 回复 支持 反对
发表于 2022-7-13 13:39:00 | 显示全部楼层

由于我的服务器是被黑客入侵了,所以重装系统时就改了ip
使用道具 举报 回复 支持 反对
发表于 2022-7-13 14:03:49 | 显示全部楼层
1636602537nwuu 发表于 2022-7-13 13:39
由于我的服务器是被黑客入侵了,所以重装系统时就改了ip

有办法解决吗这个?
使用道具 举报 回复 支持 反对
发表于 2022-7-13 14:55:54 | 显示全部楼层
1636602537nwuu 发表于 2022-7-13 14:03
有办法解决吗这个?

ip变化了,之前活动赠送的券就没有办法再新ip上使用了。
使用道具 举报 回复 支持 反对
发表于 2022-7-13 15:04:43 | 显示全部楼层
大炮运维V587 发表于 2022-7-13 14:55
ip变化了,之前活动赠送的券就没有办法再新ip上使用了。

那我白搞了啊,有没有办法内部帮我改下ip呢?
使用道具 举报 回复 支持 反对
发表于 2022-7-14 10:05:52 | 显示全部楼层
1636602537nwuu 发表于 2022-7-13 15:04
那我白搞了啊,有没有办法内部帮我改下ip呢?

活动赠送的券,没法修改ip。
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术免费分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表