Join the community today
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

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    5:03 AM
    1.15.x
    MariaDB 10.1
    The curl header is the same for both domains:
    Code (Text):
    HTTP/1.1 302 Moved Temporarily
    Date: Tue, 18 Jul 2017 09:21:27 GMT
    Content-Type: text/html
    Content-Length: 154
    Connection: keep-alive
    Location: https://www.utahfishkeepers.us/
    Server: nginx centminmod
    X-Powered-By: centminmod
    

    Here are the contents of the nginx vhost:
    Code (Text):
    # 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://www.utahfishkeepers.us$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 for security] {
        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;
    }
    

    and this is the output of grep -rn 302 /usr/local/nginx/conf/:
    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 /;
    

     
  2. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    5:03 AM
    1.15.x
    MariaDB 10.1
    Now the sites are working again. Very weird.
     
  3. eva2000

    eva2000 Administrator Staff Member

    44,750
    10,204
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,815
    Local Time:
    9:03 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    don't use 302 redirects with /usr/local/nginx/conf/conf.d/carpcharacin.rocks.ssl.conf like
    Code (Text):
    return 302 https://$server_name$request_uri;
    

    Set the specific domain you want to redirect to
    Code (Text):
    return 302 https://domain.com$request_uri;
    

    also test if it's IPv6 related via curl
    Code (Text):
    curl -Iv http://domain.com
    

    Code (Text):
    dig +short A domain.com
    

    Code (Text):
    dig +short AAAA domain.com
    
     
  4. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    5:03 AM
    1.15.x
    MariaDB 10.1
    I'm pretty sure the vhost carpcharacin.rocks was generated with the built in wp auto installer.
    Code (Text):
    * About to connect() to www.utahfishkeepers.us port 80 (#0)
    *   Trying 2600:3c01::f03c:91ff:fe2c:f69e...
    * Connected to www.utahfishkeepers.us (2600:3c01::f03c:91ff:fe2c:f69e) port #0)
    > HEAD / HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: www.utahfishkeepers.us
    > Accept: */*
    >
    < HTTP/1.1 301 Moved Permanently
    HTTP/1.1 301 Moved Permanently
    < Date: Fri, 21 Jul 2017 11:53:58 GMT
    Date: Fri, 21 Jul 2017 11:53:58 GMT
    < Content-Type: text/html
    Content-Type: text/html
    < Content-Length: 178
    Content-Length: 178
    < Connection: keep-alive
    Connection: keep-alive
    < Location: https://www.utahfishkeepers.us/
    Location: https://www.utahfishkeepers.us/
    < Server: nginx centminmod
    Server: nginx centminmod
    < X-Powered-By: centminmod
    X-Powered-By: centminmod
    
    <
    * Connection #0 to host www.utahfishkeepers.us left intact
    

    The output of dig +short A www.utahfishkeepers.us is 173.255.217.82 and the output of dig +short AAAA www.utahfishkeepers.us is 2600:3c01::f03c:91ff:fe2c:f69e. It is the same for the other two domains. It seems like the other sites work at some parts of the day, but not others.

    Could removing xf2.utahfishkeepers.us help? I've been planning on deleting it for a while, it's still on dev preview 2.
     
  5. eva2000

    eva2000 Administrator Staff Member

    44,750
    10,204
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,815
    Local Time:
    9:03 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    strange.. could be your end issue i.e. local ISP DNS resolver ? though I don't think it is.

    try bypassing your local DNS resolution on your system by editing local hosts file with your domains' ip address

    To bypass, on Windows PC edit your windows HOSTS file at c:\Windows\System32\Drivers\etc\hosts (see guide at Modify your hosts file | Knowledge Center | Rackspace Hosting or install Hostman app HostsMan - abelhadigital.com which can manage the file too and allows easy dns flushing when you make changes to the hosts file.

    c:\Windows\System32\Drivers\etc\hosts contents to preview without DNS update this tells your local PC that the following domains utahfishkeepers.us www.utahfishkeepers.us xf2.utahfishkeepers.us resolve to the particular IPv4 address bypassing your ISP's DNS resolution
    Code (Text):
    173.255.217.82 utahfishkeepers.us www.utahfishkeepers.us xf2.utahfishkeepers.us

    to disable, comment it out and flush dns for your system
    Code (Text):
    #173.255.217.82 utahfishkeepers.us www.utahfishkeepers.us xf2.utahfishkeepers.us

    i.e. via Hostsman app to flush dns and edit the c:\Windows\System32\Drivers\etc\hosts file
     
    Last edited: Jul 22, 2017
  6. eva2000

    eva2000 Administrator Staff Member

    44,750
    10,204
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,815
    Local Time:
    9:03 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    you can also use an uptime monitoring service which has 1 minute interval checks to monitor actual text on a specified web page for each site so if the redirect issue happens the text on the page will change and be alerted to issues

    Hetrixtools free plan allows 1 min frequency checks so you can add a website uptime monitor
     
  7. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    5:03 AM
    1.15.x
    MariaDB 10.1
    It also redirects on my phone, but before it redirects it says the certificate name is invalid. When carpcharacin.rocks is working, the certificate is valid.
     
  8. eva2000

    eva2000 Administrator Staff Member

    44,750
    10,204
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,815
    Local Time:
    9:03 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    what phone browser and version ? phone OS ? what desktop web browser you use ?

    try in latest Chrome and firefox browsers on desktop and phone.

    could be your browser has buggy SNI support if you have multiple sites with HTTPS off of a single IP

    Server Name Indication - Wikipedia

    old browsers don't support SNI i.e. on winxp ie8 so would need a separate IP for each HTTPS enabled site

    but if it works sometimes for you and not others, might not be the issue
     
  9. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    5:03 AM
    1.15.x
    MariaDB 10.1
    I have android 7.0 and the latest version of chrome on my phone, and I have chrome 59 on my computer. The sites work sometimes, but other times they redirect to utahfishkeepers.us and xf2.utahfishkeepers.us dosen't have HTTPS, but it also redirects.
     
  10. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    5:03 AM
    1.15.x
    MariaDB 10.1
    I just did the edit and xf2.utahfishkeepers.us is working on my computer, but it still redirects on my phone even though it isn't connected to my home ISP, just the cell phone network.

    Edit: I removed the edit and flushed dns resolver cache, and now it redirects again.
     
  11. eva2000

    eva2000 Administrator Staff Member

    44,750
    10,204
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,815
    Local Time:
    9:03 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    strange then.. but 100% consistently works on desktop pc right ?
     
  12. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    5:03 AM
    1.15.x
    MariaDB 10.1
    It worked when I made the edit, but when I removed the edit and flushed the dns cache it went back to redirecting on my computer.
     
  13. eva2000

    eva2000 Administrator Staff Member

    44,750
    10,204
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,815
    Local Time:
    9:03 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
  14. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    5:03 AM
    1.15.x
    MariaDB 10.1
  15. eva2000

    eva2000 Administrator Staff Member

    44,750
    10,204
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,815
    Local Time:
    9:03 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    what's contents of your nginx vhost for xf2.utahfishkeepers.us ?
     
  16. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    5:03 AM
    1.15.x
    MariaDB 10.1
    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name xf2.utahfishkeepers.us;
    #            return 301 $scheme://www.xf2.utahfishkeepers.us$request_uri;
    #       }
    
    server {
      server_name xf2.utahfishkeepers.us www.xf2.utahfishkeepers.us;
    
    # 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;
    
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
      add_header X-Robots-Tag "noindex, nofollow";
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/xf2.utahfishkeepers.us/log/access.log combined buffer=256k flush=60m;
      error_log /home/nginx/domains/xf2.utahfishkeepers.us/log/error.log;
    
      root /home/nginx/domains/xf2.utahfishkeepers.us/public;
    
    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 YOURIPADDRESS;
            #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 YOURIPADDRESS;
            #deny all;
    }
    
    location /internal_data/ {
         internal;
         allow 127.0.0.1;
         #allow YOURIPADDRESS;
         deny all;
    }
    
    location /library/ {
         internal;
         allow 127.0.0.1;
         #allow YOURIPADDRESS;
         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;
    }
    
     
  17. eva2000

    eva2000 Administrator Staff Member

    44,750
    10,204
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,815
    Local Time:
    9:03 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    try setting up similar listen 80/443 directives with ipv4/ipv6 for xf2.utahfishkeepers.us as you did for other domains
     
  18. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    5:03 AM
    1.15.x
    MariaDB 10.1
    Like this?
    Code:
        listen   80;
        listen [2600:3c01::f03c:91ff:fe2c:f69e]:80;
        listen   443;
        listen [2600:3c01::f03c:91ff:fe2c:f69e]:443;
    carpcharacin.rocks is still redirecting, the vhost was generated when I used the wordpress installer built into centmin mod. Could I just delete xf2.utahfishkeepers.us, since it is a test site that I'm not really using?
     
  19. eva2000

    eva2000 Administrator Staff Member

    44,750
    10,204
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,815
    Local Time:
    9:03 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    yeah like that for the listen directives

    as to deleting you could, though personally i'd suggest you leave it to figure out the problem first
     
  20. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    5:03 AM
    1.15.x
    MariaDB 10.1
    OK, I'll leave it and add the listen directives.