群主帮我看看怎么添加多个店铺二级域名 比如a.abc.com b.abc.com c.abc.com ............ 我已经申请了通配符SSL证书

5.03K 浏览M2安装设置magento2

群主帮我看看怎么添加多个店铺二级域名 比如a.abc.com b.abc.com c.abc.com ............ 我已经申请了通配符SSL证书

我已经申请了www.abc.com通配符SSL证书

下面代码中怎么添加多个店铺二级域名 比如a.abc.com b.abc.com c.abc.com ............

强制HTTPS
只有SSL,没安装Varnish的情况下

Nginx配置文件

server
server
<span class="token punctuation">{</span>
    listen <span class="token number">80</span><span class="token punctuation">;</span>
   listen <span class="token number">443</span> ssl http2<span class="token punctuation">;</span>
    server_name yourdomain<span class="token punctuation">.</span>com www<span class="token punctuation">.</span>yourdomain<span class="token punctuation">.</span>com<span class="token punctuation">;</span>
    index index<span class="token punctuation">.</span>php index<span class="token punctuation">.</span>html index<span class="token punctuation">.</span>htm default<span class="token punctuation">.</span>php default<span class="token punctuation">.</span>htm default<span class="token punctuation">.</span>html<span class="token punctuation">;</span>
    set $MAGE_ROOT <span class="token operator">/</span>var<span class="token operator">/</span>www<span class="token operator">/</span>magento2<span class="token operator">-</span>live<span class="token operator">/</span><span class="token punctuation">;</span>
    set $MAGE_MODE production<span class="token punctuation">;</span>
    set $MAGE_RUN_TYPE store<span class="token punctuation">;</span>
    include <span class="token operator">/</span>var<span class="token operator">/</span>www<span class="token operator">/</span>magento2<span class="token operator">-</span>live<span class="token operator">/</span>nginx<span class="token punctuation">.</span>conf<span class="token punctuation">.</span>sample<span class="token punctuation">;</span> 
    #SSL<span class="token operator">-</span>START 
    #error_page <span class="token number">404</span><span class="token operator">/</span><span class="token number">404.</span>html<span class="token punctuation">;</span>
    #HTTP_TO_HTTPS_START
    <span class="token keyword">if</span> <span class="token punctuation">(</span>$server_port <span class="token operator">!</span><span class="token operator">~</span> <span class="token number">443</span><span class="token punctuation">)</span><span class="token punctuation">{</span>
        rewrite <span class="token operator">^</span><span class="token punctuation">(</span><span class="token operator">/</span><span class="token punctuation">.</span><span class="token operator">*</span><span class="token punctuation">)</span>$ https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>$host$<span class="token number">1</span> permanent<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    #HTTP_TO_HTTPS_END
    ssl_certificate <span class="token operator">/</span>etc<span class="token operator">/</span>nginx<span class="token operator">/</span>ssl<span class="token operator">/</span>magento2<span class="token operator">/</span>ssl<span class="token operator">-</span>cert<span class="token operator">-</span>snakeoil<span class="token punctuation">.</span>pem<span class="token punctuation">;</span> #change with your SSL cert
    ssl_certificate_key <span class="token operator">/</span>etc<span class="token operator">/</span>nginx<span class="token operator">/</span>ssl<span class="token operator">/</span>magento2<span class="token operator">/</span>ssl<span class="token operator">-</span>cert<span class="token operator">-</span>snakeoil<span class="token punctuation">.</span>key<span class="token punctuation">;</span> # change with your SSL key
    ssl_protocols TLSv1 TLSv1<span class="token punctuation">.</span><span class="token number">1</span> TLSv1<span class="token punctuation">.</span><span class="token number">2</span><span class="token punctuation">;</span>
    ssl_ciphers ECDHE<span class="token operator">-</span>RSA<span class="token operator">-</span>AES128<span class="token operator">-</span>GCM<span class="token operator">-</span>SHA256<span class="token punctuation">:</span>HIGH<span class="token punctuation">:</span><span class="token operator">!</span>aNULL<span class="token punctuation">:</span><span class="token operator">!</span>MD5<span class="token punctuation">:</span><span class="token operator">!</span>RC4<span class="token punctuation">:</span><span class="token operator">!</span>DHE<span class="token punctuation">;</span>
    ssl_prefer_server_ciphers on<span class="token punctuation">;</span>
    ssl_session_cache shared<span class="token punctuation">:</span>SSL<span class="token punctuation">:</span><span class="token number">10</span>m<span class="token punctuation">;</span>
    ssl_session_timeout <span class="token number">10</span>m<span class="token punctuation">;</span>
    #SSL<span class="token operator">-</span>END

<span class="token punctuation">}</span>
已回答
0

为什么看问题都要积分

发表新评论

不好意思啊,之前修改有个bug导致的。现在好了。能直接看问题,不需要积分。

0

为啥你的代码都乱了? 是编辑器的原因吗? 还是你从哪里复制过来的?

发表新评论

代码先复制到记事本去掉html标签,再复制到这里

从你教程里面复制过来的

0