子域的Nginx ssl配置

时间:2017-08-21 09:39:51

标签: ssl nginx

我有一个网站和多个子域名。在每个子域中,除了一个子域外,我使用CMS,使用Let的加密生成它自己的ssl。在剩余的子域名中,我想从Cloudflare添加自己的证书。我现在生成了一个证书,将它放在我的public class MainActivity extends AppCompatActivity { private DrawerLayout mDrawerLayout; private ListView mDrawerList; private String[] mPlanetTitles; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowTitleEnabled(false); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerList = (ListView) findViewById(R.id.left_drawer); mPlanetTitles = getResources().getStringArray(R.array.planets_array); // Set the adapter for the list view mDrawerList.setAdapter(new ArrayAdapter<String>(this, R.layout.drawer_list_item, mPlanetTitles)); mDrawerList.setOnItemClickListener(new DrawerItemClickListener()); // *** Set your desired icon getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_drawer); // *** Replace the DrawerListener functionality of the ActionBarDrawerToggle mDrawerLayout.addDrawerListener(new DrawerLayout.SimpleDrawerListener() { @Override public void onDrawerClosed(View view) { invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu() } @Override public void onDrawerOpened(View drawerView) { invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu() } } ); } @Override public boolean onOptionsItemSelected(MenuItem item) { // *** If the home button is clicked, open/close the drawer as needed if (item.getItemId() == android.R.id.home) { if (mDrawerLayout.isDrawerOpen(GravityCompat.START)) { mDrawerLayout.closeDrawer(GravityCompat.START); } else { mDrawerLayout.openDrawer(GravityCompat.START); } return true; } return super.onOptionsItemSelected(item); } @Override protected void onPostCreate(Bundle savedInstanceState) { super.onPostCreate(savedInstanceState); } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); } /* The click listner for ListView in the navigation drawer */ private class DrawerItemClickListener implements ListView.OnItemClickListener { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { } } } 中。只是为了测试。在nginx中我配置了这个块:

/var/www/my/

我的实现似乎有问题,因为现在my.domain.com可以正常工作,但是对于其他一切我从Cloudflare得到了这个错误:Error 525: SSL handshake failed

任何想法我做错了什么?

谢谢

编辑:

这是来自CMS的conf文件。这就是他们设置证书的方式。

server{
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    ssl_certificate /var/www/my/fullchain.cer;
    ssl_certificate_key /var/www/my/my.domain.com.key;
    root /var/www/my;

    index index.php index.html;

    server_name my.domain.com;
    location / {
         try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include /etc/nginx/fastcgi_params;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /var/www/my/$fastcgi_script_name;
    }

    location ~ /\.ht {
        deny all;
    }
}

0 个答案:

没有答案