I've got this website on nginx, it's a php script for an image site.
The problem is that whenever I click on a link on the homepage it gives me a 404. I can access the homepage and it shows the last images and I can access and use the admin panel so the script or it's installation is not the problem.
I believe the problem is with my nginx.conf file but it's my first time using it and I can't find the problem. I'm pretty sure it's some easy thing on the http part.
Can anyone see what the problem is?
I attach the nginx.conf.
user www-data;
worker_processes 5;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
index index.php;
##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;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##
#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
I add the sites-enabled and sites-available files for the site in question.
SITES ENABLED FILE
server {
listen *:80;
server_name MYSITE.com ;
root /var/www/MYSITE.com/web;
index index.php;
location ~ \.shtml$ {
ssi on;
}
error_log /var/log/ispconfig/httpd/MYSITE.com/error.log;
access_log /var/log/ispconfig/httpd/MYSITE.com/access.log combined;
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location /stats {
index index.html index.php;
auth_basic "Members Only";
auth_basic_user_file /var/www/clients/client0/web1/web/stats/.htpasswd_stats;
}
location ^~ /awstats-icon {
alias /usr/share/awstats/icon;
}
location ~ \.php$ {
try_files /446853f6175b4ee703d1115b71d6c0c9.htm @php;
}
location @php {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/lib/php5-fpm/web1.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
location /cgi-bin/ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
root /var/www/clients/client0/web1;
gzip off;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_index index.cgi;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
}
SITES AVAILABLE FILE
server {
listen *:80;
server_name MYSITE.com ;
root /var/www/MYSITE.com/web;
index index.php;
location ~ \.shtml$ {
ssi on;
}
error_log /var/log/ispconfig/httpd/MYSITE.com/error.log;
access_log /var/log/ispconfig/httpd/MYSITE.com/access.log combined;
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location /stats {
index index.html index.php;
auth_basic "Members Only";
auth_basic_user_file /var/www/clients/client0/web1/web/stats/.htpasswd_stats;
}
location ^~ /awstats-icon {
alias /usr/share/awstats/icon;
}
location ~ \.php$ {
try_files /446853f6175b4ee703d1115b71d6c0c9.htm @php;
}
location @php {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/lib/php5-fpm/web1.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
location /cgi-bin/ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
root /var/www/clients/client0/web1;
gzip off;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_index index.cgi;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
}
I add the last lines of /var/log/ispconfig/httpd/MYSITE.com/error.log to my post. (It's a pain to edit the domain so I'll just leave it there and edit the question later)
2013/08/29 03:20:28 [error] 30672#0: *513 open() "/var/www/cosplayde.com/web/asdasd" failed (2: No such file or directory), client: 66.249.75.229, server: cosplayde.com, request: "GET /asdasd HTTP/1.1", host: "cosplayde.com"
2013/08/29 03:20:29 [error] 30672#0: *513 open() "/var/www/cosplayde.com/web/hebi" failed (2: No such file or directory), client: 66.249.75.229, server: cosplayde.com, request: "GET /hebi HTTP/1.1", host: "cosplayde.com"
2013/08/29 03:20:42 [error] 30672#0: *514 open() "/var/www/cosplayde.com/web/asdsa" failed (2: No such file or directory), client: 66.249.75.229, server: cosplayde.com, request: "GET /asdsa HTTP/1.1", host: "cosplayde.com"
2013/08/29 03:21:43 [error] 30672#0: *515 open() "/var/www/cosplayde.com/web/casper" failed (2: No such file or directory), client: 66.249.75.229, server: cosplayde.com, request: "GET /casper HTTP/1.1", host: "cosplayde.com"
2013/08/29 05:26:47 [error] 30672#0: *544 open() "/var/www/cosplayde.com/web/apple-touch-icon.png" failed (2: No such file or directory), client: 66.249.75.229, server: cosplayde.com, request: "GET /apple-touch-icon.png HTTP/1.1", host: "cosplayde.com"
2013/08/29 05:27:16 [error] 30672#0: *545 open() "/var/www/cosplayde.com/web/apple-touch-icon-precomposed.png" failed (2: No such file or directory), client: 66.249.75.229, server: cosplayde.com, request: "GET /apple-touch-icon-precomposed.png HTTP/1.1", host: "cosplayde.com"
2013/08/29 16:43:52 [error] 30670#0: *688 open() "/var/www/cosplayde.com/web/3" failed (2: No such file or directory), client: 66.249.72.229, server: cosplayde.com, request: "GET /3 HTTP/1.1", host: "cosplayde.com"
2013/08/29 16:44:20 [error] 30670#0: *689 open() "/var/www/cosplayde.com/web/2" failed (2: No such file or directory), client: 66.249.72.229, server: cosplayde.com, request: "GET /2 HTTP/1.1", host: "cosplayde.com"
2013/08/29 16:44:55 [error] 30670#0: *690 open() "/var/www/cosplayde.com/web/5" failed (2: No such file or directory), client: 66.249.72.229, server: cosplayde.com, request: "GET /5 HTTP/1.1", host: "cosplayde.com"
2013/08/29 16:45:29 [error] 30670#0: *692 open() "/var/www/cosplayde.com/web/rss" failed (2: No such file or directory), client: 66.249.72.229, server: cosplayde.com, request: "GET /rss HTTP/1.1", host: "cosplayde.com"
2013/08/29 16:46:04 [error] 30670#0: *693 open() "/var/www/cosplayde.com/web/hebi" failed (2: No such file or directory), client: 66.249.72.229, server: cosplayde.com, request: "GET /hebi HTTP/1.1", host: "cosplayde.com"
2013/08/29 16:46:38 [error] 30670#0: *694 open() "/var/www/cosplayde.com/web/asdsa" failed (2: No such file or directory), client: 66.249.72.229, server: cosplayde.com, request: "GET /asdsa HTTP/1.1", host: "cosplayde.com"
2013/08/29 16:47:12 [error] 30670#0: *695 open() "/var/www/cosplayde.com/web/dolina" failed (2: No such file or directory), client: 66.249.72.229, server: cosplayde.com, request: "GET /dolina HTTP/1.1", host: "cosplayde.com"
2013/08/29 16:47:47 [error] 30670#0: *696 open() "/var/www/cosplayde.com/web/touhou" failed (2: No such file or directory), client: 66.249.72.229, server: cosplayde.com, request: "GET /touhou HTTP/1.1", host: "cosplayde.com"
2013/08/29 16:48:22 [error] 30670#0: *697 open() "/var/www/cosplayde.com/web/kyuutsui" failed (2: No such file or directory), client: 66.249.72.229, server: cosplayde.com, request: "GET /kyuutsui HTTP/1.1", host: "cosplayde.com"
2013/08/29 16:48:58 [error] 30670#0: *698 open() "/var/www/cosplayde.com/web/cosplay-sexy" failed (2: No such file or directory), client: 66.249.72.229, server: cosplayde.com, request: "GET /cosplay-sexy HTTP/1.1", host: "cosplayde.com"
2013/08/29 16:49:34 [error] 30670#0: *699 open() "/var/www/cosplayde.com/web/submit_images" failed (2: No such file or directory), client: 66.249.72.229, server: cosplayde.com, request: "GET /submit_images HTTP/1.1", host: "cosplayde.com"
2013/08/29 16:50:16 [error] 30670#0: *701 open() "/var/www/cosplayde.com/web/category/default" failed (2: No such file or directory), client: 66.249.72.229, server: cosplayde.com, request: "GET /category/default HTTP/1.1", host: "cosplayde.com"
2013/08/30 05:38:23 [error] 30669#0: *916 open() "/var/www/cosplayde.com/web/category/default" failed (2: No such file or directory), client: 120.151.131.182, server: cosplayde.com, request: "GET /category/default HTTP/1.1", host: "cosplayde.com", referrer: "http://cosplayde.com/"
2013/08/30 05:39:33 [error] 30669#0: *916 open() "/var/www/cosplayde.com/web/rss" failed (2: No such file or directory), client: 120.151.131.182, server: cosplayde.com, request: "GET /rss HTTP/1.1", host: "cosplayde.com", referrer: "http://cosplayde.com/"
2013/08/30 06:05:32 [error] 30669#0: *940 open() "/var/www/cosplayde.com/web/5" failed (2: No such file or directory), client: 200.126.222.14, server: cosplayde.com, request: "GET /5 HTTP/1.1", host: "cosplayde.com", referrer: "http://cosplayde.com/"
2013/08/30 06:17:24 [error] 10945#0: *1 open() "/var/www/cosplayde.com/web/5" failed (2: No such file or directory), client: 190.193.156.31, server: cosplayde.com, request: "GET /5 HTTP/1.1", host: "cosplayde.com", referrer: "http://cosplayde.com/"
2013/08/30 06:21:57 [error] 11863#0: *47 open() "/var/www/cosplayde.com/web/5" failed (2: No such file or directory), client: 200.126.222.14, server: cosplayde.com, request: "GET /5 HTTP/1.1", host: "cosplayde.com", referrer: "http://cosplayde.com/"
2013/08/30 06:22:10 [error] 11863#0: *47 open() "/var/www/cosplayde.com/web/kyuutsui" failed (2: No such file or directory), client: 200.126.222.14, server: cosplayde.com, request: "GET /kyuutsui HTTP/1.1", host: "cosplayde.com", referrer: "http://cosplayde.com/"