Nginx Configuration Problems

Some of you may recognize me from IRC where I originally posted this but I still haven't managed to fix the problem. For those that don't, see http://pastebin.com/A7prbuwU for initial problem report. I have fixed the syntax error with double location and have replaced the config files with what I have below. The problem now is that I still can't connect to my website (generic Firefox can't establish a connection to the server message) and Nginx isn't reporting anything wrong when I restart it.

This is what I currently have in my configuration files;

/nginx/sites-available/myurl.com

        server {
            server_name http://www.myurl.com myurl.com;
             root /home/tyrx/domains/myurl.com/public_html;
             access_log /home/tyrx/domains/myurl.com/logs/access.log;
             error_log /home/tyrx/domains/myurl.com/logs/error.log;

        location / {
                try_files $uri $uri/ /index.php?$uri&$args;
                index index.php index.html;
        }

        location /internal_data/ {
                internal;
        }
        location /library/ {
               internal;
        }

        location ~ \.php$ {
                try_files $uri /index.php
                fastcgi_pass    127.0.0.1:9000;
                fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include         fastcgi_params;
        }
        }

/nginx/sites-enabled/myurl.com - this is the syslink which I created using the “ln –s” command

        #####
    server {
        server_name www.myurl.com myurl.com;
         root /home/tyrx/domains/myurl.com/public_html;
         access_log /home/tyrx/domains/myurl.com/logs/access.log;
         error_log /home/tyrx/domains/myurl.com/logs/error.log;

    location / {
            try_files $uri $uri/ /index.php?$uri&$args;
            index index.php index.html;
    }

    location /internal_data/ {
            internal;
    }
    location /library/ {
           internal;
    }

    location ~ \.php$ {
            try_files $uri /index.php
            fastcgi_pass    127.0.0.1:9000;
            fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include         fastcgi_params;
    }
    }

This is my /etc/nginx/nginx.conf file -

            user www-data;
            worker_processes 1;

            error_log /var/log/nginx/error.log warn;
            pid /var/run/nginx.pid;

            events {
                worker_connections  1024;
            }

            http {

                # Basic Settings
                client_max_body_size 50m;
                client_header_timeout 5;
                keepalive_timeout 5;
                port_in_redirect off;
                sendfile on;
                server_tokens off;
                server_name_in_redirect off;
                tcp_nopush on;
                tcp_nodelay on;
                types_hash_max_size 2048;

                # MIME
                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 warn;

                # Gzip Settings
                gzip on;
                gzip_disable    "msie6";
                gzip_min_length 1400;
                gzip_types      text/plain text/css text/javascript text/xml application/x-javascript application/xml applicatio$

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

I was going to post this on the xenforo forums but I figure it's most likely a problem with my inexperience with Linux rather than that of Xenforo so I think these forums would be more appropriate. It's also worth mentioning that my website works with the default configuration and it's only when I attempt adding these rules for friendly URLs that this problem occurs.

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct