0

My brain is breaking over this. Every site I have is redirecting back to one of my other ones... I would say it was the /default site, but it wasn't until I just made it the default site, which changed nothing. All urls put me back at www.justaleaf.com

(all websites worked prior to transition, and the myhashimotos site was working a little bit ago due to the redirect landing there when I disabled all the other sites)

Here are my configurations (ubuntu with mysql php-fpm)... I'm new to nginx and I'm just lost now:

/etc/nginx/nginx.conf

    user www-data;
worker_processes 4;
pid /var/run/nginx.pid;

events {
        worker_connections 768;
        multi_accept on;
        use epoll;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        #tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        limit_req_zone  $binary_remote_addr  zone=one:10m   rate=1r/s;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
    }


    #mail {
    #       # See sample authentication script at:
    #       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
    #
    #       # auth_http localhost/auth.php;
    #       # pop3_capabilities "TOP" "USER";
    #       # imap_capabilities "IMAP4rev1" "UIDPLUS";
    #
    #       server {
    #               listen     localhost:110;
    #               protocol   pop3;
    #               proxy      on;
    #       }
    #
    #       server {
    #               listen     localhost:143;
    #               protocol   imap;
    #               proxy      on;
    #       }
    #}

directory contents

justaleaf@webserver  /etc/nginx/sites-available
$ ls -a
.   default           www.harmonicult.com  .www.justaleaf.com.swp
..  default.dpkg-old  www.justaleaf.com    www.myhashimotosthyroiditis.com
justaleaf@webserver  /etc/nginx/sites-available
$ ls -a ../sites-enabled
.   www.justaleaf.com   www.myhashimotosthyroiditis.com
..  www.harmonicult.com  

And here are my site confs:

/www.myhashimotosthyroiditis.com

/www.harmonicult.com

/www.justaleaf.com

Note: to test, just try going to myhashimotosthyroiditis.com, the redirect is obvious there.

  • Why do you have a default.conf and a www.justaleaf.com conf with the same info in it? Have you tried removing default.conf? – tfitzgerald Apr 17 '12 at 3:24
  • yeah, actually, those two aren't usually up at the same time. I was trying to use the default conf to see if nginx would listen to me if it were named that. I'm going to drop default, for now. – Garrett Apr 17 '12 at 4:02
2

The second server in harmonicult has a / in it; line 12 in http://pastie.org/3801824 Pretty sure that's not allowed in server_name.

(Tried to make this as a comment, but I need rep for that, so oh well. Hopefully this helps.)

  • Thanks for the suggestion... unfortunately that didn't impact this situation. – Garrett Apr 17 '12 at 7:17
  • Could you rehost the configs? pastie.org went down and I'd like to give this another try. – Sašo Apr 25 '12 at 6:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.