# NGinx is so messed up...



## Anon (Sep 24, 2011)

Only things in the root folder of nginx work (display in browser), everything else returns 403 or 404.


----------



## graudeejs (Sep 24, 2011)

So you probably haven't read documentation.
nginx is great web server


----------



## Anon (Sep 24, 2011)

graudeejs said:
			
		

> So you probably haven't read documentation.
> nginx is great web server



What's the issue? I've installed nGinx on Linux in the past with no issues.


```
#user nginx nginx;
worker_processes 4;

#error_log /usr/local/www/nginx/error_log info;

events {
	worker_connections 1024;
}

http {
	default_type application/octet-stream;

	client_header_timeout 66m;
	client_body_timeout 66m;
	send_timeout 66m;

	connection_pool_size 1024;
	client_header_buffer_size 128k;
	large_client_header_buffers 4 1024k;
	request_pool_size 512k;

	gzip on;
	gzip_min_length 1100;
	gzip_buffers 4 8k;
	gzip_types text/plain;

	output_buffers 1 3072;
	postpone_output 1460;

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;

	keepalive_timeout 75 20;

	ignore_invalid_headers on;

	index index.html;
	
	server_tokens off;
	client_max_body_size 10M;
	
	server {
		listen 80;
		server_name my-site-name;

		root /usr/local/www/nginx/;
                location ~ .php$ {
			if (!-f $request_filename) {
			return 404;
			}
                        fastcgi_pass 127.0.0.1:9000;
			include fastcgi.conf;
			fastcgi_intercept_errors on;
			fastcgi_read_timeout 360;
			fastcgi_connect_timeout 360;
			fastcgi_send_timeout 360;
			fastcgi_buffer_size 2048k;
			fastcgi_buffers 8 2048k;
			fastcgi_busy_buffers_size 2048k;
			fastcgi_temp_file_write_size 2048k;
                }

		location / {
        	if ($request_uri ~* (^\/|\.html|\.jpg|\.org|\.png|\.css|favicon\.ico|robots\.txt)$ ) {
          	break;
        	}
        	return 444;
      		}

        	location /phpmyadmin/ {
            		alias       /usr/local/www/phpMyAdmin/;
            		index index.php index.html;
        	}
 
        	location ~ ^/phpmyadmin/(.*\.php)$ {
            		root                /usr/local/www/phpMyAdmin/;
            		fastcgi_pass        unix:/tmp/php-fpm.sock;
            		include             fastcgi_params;
            		fastcgi_param       SCRIPT_FILENAME /usr/local/www/phpMyAdmin/$1;
            		fastcgi_param       DOCUMENT_ROOT /usr/local/www/phpMyAdmin;
        	}
	}
}
```


----------



## Anon (Sep 24, 2011)

Nevermind guys, fixed! Please delete this thread now.


----------



## Goose997 (Sep 24, 2011)

What was wrong?


----------



## redw0lfx (Sep 24, 2011)

I think the whole forum would benefit if you would post what the issue was and what you did to fix it and then mark the thread as solved.  It makes it easier for other users searching for the same issue you had and not end up with posts that just say 'solved' but no explanation as to how.

Just my 0.02.


----------



## onyxrev (Sep 25, 2011)

Probably just had the permissions wrong such that nginx couldn't read the files.  That's literally what the response codes mean, anyway.


----------

