redirect to https

Discussion in 'ISPConfig 3 Priority Support' started by bobpit, Jan 26, 2014.

  1. bobpit

    bobpit Member

    I want to redirect all versions of the domain ( and to . I have Ubuntu 12.04 and nginx 1.4.4. How do I do this from inside ispconfig3?

    I had solved the problem of redirection manually (see

    I just realized that my changes are canceled, so the redirection to https does not work any more. I assume this happened after I went to ispconfig Web Domain -> Options and set [Use Socket For PHP-FPM] to YES.

    So is there a way to make the redirection correctly from inside ispconfig?


    I was preparing to follow this guide to optimize the server:

    But I started wondering if any of these changes (like the various caches) can be done from inside ispconfig and I might mess things up. Are they?
    Last edited: Jan 27, 2014
  2. falko

    falko Super Moderator ISPConfig Developer

    Use something like this in the nginx Directives field in ISPConfig:

    if ($scheme != "https") {
      rewrite ^ https://www.yourdomain.tld$request_uri? permanent;
  3. bobpit

    bobpit Member

    I did and now it takes me to : https://www.yourdomain.tld/

    I know, I know, I forgot to put MY DOMAIN name.

    So I erased it and I put:
    if ($scheme != "https") {
      rewrite ^$request_uri? permanent;
    It still takes me to https://www.yourdomain.tld/ . Obviously this is written somewhere and I cannot remove it.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The config is written once a minute, so you have to wait a minute. and such redirects are cached by the web browser. so close your browser and open it again.
  5. bobpit

    bobpit Member

  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The changes in the nginx.conf file and the mysql my.cnf file will not get overwritten by ispconfig. For the changes in the php-fpm configuration and the nginx vhost files, edit the configuration file templates in /usr/local/ispconfig/server/conf/. The modified versions of the files in /usr/local/ispconfig/server/conf/ have to be saved in /usr/local/ispconfig/server/conf-custom/

Share This Page