关于#nginx#的问题,如何解决?

通过nginx转发到前端的域名发生改变
问题相关代码,请勿粘贴截图

后台传送的代码为http://218.195.109.72:8000/web-apps/apps/api/documents/api.js

nginx配置为

#user nobody;
worker_processes 1;

#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;

#pid logs/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
#                  '$status $body_bytes_sent "$http_referer" '
#                  '"$http_user_agent" "$http_x_forwarded_for"';

#access_log  logs/access.log  main;

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;

#gzip  on;

server {
    listen       80;
    server_name ybt.snut.edu.cn; 
    #server_name  218.195.109.72
    rewrite ^(.*) https://$server_name$1 permanent; #这句是代表 把http的域名请求转成https


    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        root   html;
        index  index.html index.htm;
        proxy_pass  https://ybt.snut.edu.cn; #因为这里还是80端口,所以保持http就可以了
    }

    #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;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}


# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
#    listen       8000;
#    listen       somename:8080;
#    server_name  somename  alias  another.alias;

#    location / {
#        root   html;
#        index  index.html index.htm;
#    }
#}


# HTTPS server
#
server {
    listen  443   ssl;
    server_name  ybt.snut.edu.cn; 
    #server_name  http://218.195.109.72;
     #charset koi8-r;

    #access_log  logs/host.access.log  main;

    charset utf-8;

    location ^~/ {
        root    /opt/ybt/front;
        index   /index.html; 
    }    

    location ^~/ybt/ {
        proxy_pass http://218.195.109.72:8181;
    #设置最大上传文件大小50M
    client_max_body_size  200m;
    #设置超时时间5min
    keepalive_timeout 300s;                
    }    

    location ^~/tdc/ {
        #此处为application.properties文件中配置的端口号和实际后端服务部署ip地址
        proxy_pass http://218.195.109.72:8281;
        #设置最大上传文件大小50M
        client_max_body_size  200m;
        #client_body_timeout 300s;
        #client_header_timeout 300s;
        #设置超时时间5min
        keepalive_timeout 300s;
    }
    #ssl on;
    ssl_certificate      /usr/local/nginx/snut.edu.cn.pem;
    ssl_certificate_key  /usr/local/nginx/snut.edu.cn.key;

    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;

    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;

location / {

#root html;

#index index.html index.htm;

proxy_pass https://ybt.snut.edu.cn;

}

}

include /usr/local/nginx/conf.d/*.conf;
}

运行结果及报错内容

前端映射后的端口为http://ybt.snut.edu.cn:443:8000/web-apps/apps/api/documents/api.js
多了一个443端口,而且ip直接就转成域名了

我的解答思路和尝试过的方法
我想要达到的结果

你自己配置了SSL。
这不你自己配置的吗

img