为了能快速了解并处理您的问题,请提供以下基础信息: 问题描述:宝塔上部署了一个java项目,现在的访问网址是:http://test/haoyucloud.cn:18003/,现在想把这个网址重定向到https://test/haoyucloud.cn:18003/ (端口没有变,只是http变成了https)。。 在宝塔上的nginx上应该怎么配置,我现在是这样配置的,尝试了几种配置都不行,求助一下大佬 server { listen 18008 ssl http2; server_name test.haoyucloud.cn; index index.html index.htm default.htm default.html; root /www/wucai/dist; # if ($scheme = http) { # rewrite ^ https://test.haoyucloud.cn:18008$request_uri permanent; # } # if ($scheme = http){ # rewrite ^(/.*)$ https://$hostserver_port$1 permanent; # } # if ($server_port !~ 18008){ # rewrite ^(/.*)$ https://wccc.haoyucloud.cn:18008$1 permanent; # } ssl_certificate /*****.pem; ssl_certificate_key /***.pem;
|
|