Want more timely Centmin Mod News Updates?
Become a Member

Xenforo Other sites redirect back to XF site after disk resize

Discussion in 'Forum software usage' started by CarpCharacin, Jun 7, 2017.

  1. CarpCharacin

    CarpCharacin Member

    203
    14
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +18
    Local Time:
    9:48 AM
    1.13.0
    MariaDB 10
    I recently resized my linode disks, because linode increased the storage space on their 2gb plan and now my other two sites on the vps redirect back to www.utahfishkeepers.us.
     
  2. eva2000

    eva2000 Administrator Staff Member

    29,044
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    1:48 AM
    Nginx 1.13.x
    MariaDB 5.5
    Disk resize shouldn't cause such issues. How exactly was it resized?
     
  3. CarpCharacin

    CarpCharacin Member

    203
    14
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +18
    Local Time:
    9:48 AM
    1.13.0
    MariaDB 10
    I resized it through the linode manager.
     
  4. eva2000

    eva2000 Administrator Staff Member

    29,044
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    1:48 AM
    Nginx 1.13.x
    MariaDB 5.5
    tried rebooting server ?
     
  5. CarpCharacin

    CarpCharacin Member

    203
    14
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +18
    Local Time:
    9:48 AM
    1.13.0
    MariaDB 10
    Yes, and the other two sites still redirect back to utahfishkeepers.us.
     
  6. eva2000

    eva2000 Administrator Staff Member

    29,044
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    1:48 AM
    Nginx 1.13.x
    MariaDB 5.5
    check the vhost config files, dns for the 2 domains that are redirecting and curl headers i.e.
    Code (Text):
    curl -sI http://domain.com
    
     
  7. CarpCharacin

    CarpCharacin Member

    203
    14
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +18
    Local Time:
    9:48 AM
    1.13.0
    MariaDB 10
    The vhost config files at least for my xf2 dev preview site are still there. I am using cloudflare for dns only, so I have it set to "paused".
    The curl headers are the same for both domains:
    Code (Text):
    HTTP/1.1 302 Moved Temporarily
    Date: Fri, 09 Jun 2017 01:53:25 GMT
    Content-Type: text/html
    Content-Length: 154
    Connection: keep-alive
    Location: https://www.utahfishkeepers.us/
    Server: nginx centminmod
    X-Powered-By: centminmod
    
     
  8. eva2000

    eva2000 Administrator Staff Member

    29,044
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    1:48 AM
    Nginx 1.13.x
    MariaDB 5.5
    check where 302 redirects are coming from
    Code (Text):
    grep -rn 302 /usr/local/nginx/conf/
    
     
  9. CarpCharacin

    CarpCharacin Member

    203
    14
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +18
    Local Time:
    9:48 AM
    1.13.0
    MariaDB 10
    This was the output:
    Code (Text):
    /usr/local/nginx/conf/conf.d/utahfishkeepers.us.ssl.conf:8:# if unsure use return 302 before using return 301
    /usr/local/nginx/conf/conf.d/utahfishkeepers.us.ssl.conf:22:    return 302 https://www.utahfishkeepers.us$request_uri;
    /usr/local/nginx/conf/conf.d/xf2.utahfishkeepers.us.conf:6:# if unsure use return 302 before using return 301
    /usr/local/nginx/conf/conf.d/carpcharacin.rocks.ssl.conf:6:   return 302 https://$server_name$request_uri;
    /usr/local/nginx/conf/acmevhostbackup/carpcharacin.rocks.ssl.conf-acmebackup-040117-212952:6:   return 302 https://$server_name$request_uri;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-251116-093507:8:# if unsure use return 302 before using return 301
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-251116-093507:11:    return 302 https://www.utahfishkeepers.us$request_uri;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-251116-093341:8:# if unsure use return 302 before using return 301
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-251116-093341:11:    return 302 https://www.utahfishkeepers.us$request_uri;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-092946:6:# if unsure use return 302 before using return 301
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-092946:97:  return 302 /;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-251116-092946:8:# if unsure use return 302 before using return 301
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.ssl.conf-acmebackup-251116-092946:11:    return 302 https://www.utahfishkeepers.us$request_uri;
    /usr/local/nginx/conf/acmevhostbackup/carpcharacin.rocks.conf-backup-removal-https-default-040117-212952:6:# if unsure use return 302 before using return 301
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-093507:6:# if unsure use return 302 before using return 301
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-093507:97:  return 302 /;
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-093341:6:# if unsure use return 302 before using return 301
    /usr/local/nginx/conf/acmevhostbackup/utahfishkeepers.us.conf-acmebackup-251116-093341:97:  return 302 /;
    
     
  10. eva2000

    eva2000 Administrator Staff Member

    29,044
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    1:48 AM
    Nginx 1.13.x
    MariaDB 5.5
    contents of /usr/local/nginx/conf/conf.d/utahfishkeepers.us.ssl.conf ?
     
  11. CarpCharacin

    CarpCharacin Member

    203
    14
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +18
    Local Time:
    9:48 AM
    1.13.0
    MariaDB 10
    Sorry if this is a dumb question, but how do I copy all the text from the file in nano to the clipboard on my computer? I guess I could just scroll through it and copy it piece by piece, but I could miss parts of the file.
     
  12. eva2000

    eva2000 Administrator Staff Member

    29,044
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    1:48 AM
    Nginx 1.13.x
    MariaDB 5.5
    in SSH use cat to ouput contents i.e. for file at /usr/local/nginx/conf/conf.d/utahfishkeepers.us.ssl.conf . Clear your SSH client window/buffer so only output is the contents of the file
    Code (Text):
    cat /usr/local/nginx/conf/conf.d/utahfishkeepers.us.ssl.conf
    

    Then copy and paste into Pastebin.com or Gists entry or CODE wrapped tags in post. If your SSH window scroll buffer isn't that large to get the whole contents of file, you can download file manually and copy and paste contents or increase your SSH client's scroll back buffer.
     
    • Informative Informative x 1
  13. CarpCharacin

    CarpCharacin Member

    203
    14
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +18
    Local Time:
    9:48 AM
    1.13.0
    MariaDB 10
    Thanks, that worked. I removed the phpmyadmin location, because I don't want to post that publicly for security reasons.
    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    # For HTTP/2 SSL Setup
    # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
    
    # redirect from www to non-www  forced SSL
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    # ipv4
    server {
        listen   80;
        listen [2600:3c01::f03c:91ff:fe2c:f69e]:80;
        listen   443;
        listen [2600:3c01::f03c:91ff:fe2c:f69e]:443;
    
        server_name utahfishkeepers.us;
    
      include /usr/local/nginx/conf/ssl/utahfishkeepers.us/utahfishkeepers.us.crt.key.conf;
      include /usr/local/nginx/conf/ssl_include.conf;
    
    
        return 302 https://www.utahfishkeepers.us$request_uri;
        }
    
    
    server {
        listen   80;
        listen [2600:3c01::f03c:91ff:fe2c:f69e]:80;
        server_name www.utahfishkeepers.us;
        return 301 https://$server_name$request_uri;
        }
    
    server {
        listen   443 ssl http2;
        listen [2600:3c01::f03c:91ff:fe2c:f69e]:80;
        listen [2600:3c01::f03c:91ff:fe2c:f69e]:443 ssl http2;
        server_name www.utahfishkeepers.us;
    
    
    
    
      include /usr/local/nginx/conf/ssl/utahfishkeepers.us/utahfishkeepers.us.crt.key.conf;
      include /usr/local/nginx/conf/ssl_include.conf;
    
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      # dual cert supported ssl ciphers
      ssl_ciphers     EECDH+CHACHA20-draft:EECDH+CHACHA20:EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+ECDSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+SHA384:EECDH+AES128:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!CAMELLIA;
      ssl_prefer_server_ciphers   on;
      #add_header Alternate-Protocol  443:npn-spdy/3;
      #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
      #spdy_headers_comp 5;
      ssl_buffer_size 1369;
      ssl_session_tickets on;
     
      # enable ocsp stapling
      resolver 8.8.8.8 8.8.4.4 valid=10m;
      resolver_timeout 10s;
      ssl_stapling on;
      ssl_stapling_verify on;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/utahfishkeepers.us/log/access.log combined buffer=256k flush=60m;
      error_log /home/nginx/domains/utahfishkeepers.us/log/error.log;
    
      root /home/nginx/domains/utahfishkeepers.us/public;
    
    location /[phpmyadmin location removed] {
        auth_basic                      "Restricted Access";
        auth_basic_user_file             /usr/local/nginx/pass/my_pass;
        root /usr/share/;
        include /usr/local/nginx/conf/staticfiles.conf;
        include /usr/local/nginx/conf/php.conf;
    #     include /usr/local/nginx/conf/drop.conf;
    #    include /usr/local/nginx/conf/errorpage.conf;
        }
    
    location /webmail {
    #    auth_basic                      "Restricted Access";
    #    auth_basic_user_file             /usr/local/nginx/pass/my_pass;
        root /usr/share/;
        include /usr/local/nginx/conf/staticfiles.conf;
        include /usr/local/nginx/conf/php.conf;
    #    include /usr/local/nginx/conf/drop.conf;
    #    include /usr/local/nginx/conf/errorpage.conf;
        }
    
    
    location / {
         index index.php index.html index.htm;
         try_files $uri $uri/ /index.php?$uri&$args;
    }
    
    location /admin.php {
    #     auth_basic "Private";
    #     auth_basic_user_file /usr/local/nginx/conf/htpasswd_admin_php;
            include /usr/local/nginx/conf/php.conf;
            allow 127.0.0.1;
    #        allow 173.255.217.82;
    #        deny all;
    }
    
    location /install/ {
    #     auth_basic "Private";
    #     auth_basic_user_file /usr/local/nginx/conf/htpasswd_admin_php;
            include /usr/local/nginx/conf/php.conf;
            allow 127.0.0.1;
    #        allow 173.255.217.82;
    #        deny all;
    }     
    
    location /internal_data/ {
         internal;
         allow 127.0.0.1;
         allow 173.255.217.82;
         deny all;
    }
    
    location /library/ {
         internal;
         allow 127.0.0.1;
         allow 173.255.217.82;
         deny all;
    } 
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
     
  14. eva2000

    eva2000 Administrator Staff Member

    29,044
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    1:48 AM
    Nginx 1.13.x
    MariaDB 5.5
    might be related to
    Code (Text):
    server {
       listen   80;
       listen [2600:3c01::f03c:91ff:fe2c:f69e]:80;
       server_name www.utahfishkeepers.us;
       return 301 https://$server_name$request_uri;
       }
    

    you have permanent 301 redirect to $server_name try using your www domain instead of $server_name

    same with other vhost config files for other domains for 301/302 redirects instead of $server_name use server domain name
     
  15. CarpCharacin

    CarpCharacin Member

    203
    14
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +18
    Local Time:
    9:48 AM
    1.13.0
    MariaDB 10
    So I should change it to
    Code (Text):
    server {
       listen   80;
       listen [2600:3c01::f03c:91ff:fe2c:f69e]:80;
       server_name www.utahfishkeepers.us;
       return 301 https://$www.utahfishkeepers.us$request_uri;
       }
    
    ?
     
  16. eva2000

    eva2000 Administrator Staff Member

    29,044
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    1:48 AM
    Nginx 1.13.x
    MariaDB 5.5
    remove $ in front of www
     
  17. CarpCharacin

    CarpCharacin Member

    203
    14
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +18
    Local Time:
    9:48 AM
    1.13.0
    MariaDB 10
    OK, I edited it and restarted nginx and php, but the other sites are still redirecting :(
     
  18. eva2000

    eva2000 Administrator Staff Member

    29,044
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    1:48 AM
    Nginx 1.13.x
    MariaDB 5.5
    you mean these 2 domains ?
    try systematically one by one removing 302 redirect temporarily and see what happens
     
  19. CarpCharacin

    CarpCharacin Member

    203
    14
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +18
    Local Time:
    9:48 AM
    1.13.0
    MariaDB 10
    Yes, those two domains. How do I remove the 302 redirect?
     
  20. eva2000

    eva2000 Administrator Staff Member

    29,044
    6,590
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,785
    Local Time:
    1:48 AM
    Nginx 1.13.x
    MariaDB 5.5
    comment it out with hash in front and restart nginx i.e.
    Code (Text):
    #return 302 https://www.utahfishkeepers.us$request_uri;