0

I've install Nginx on CentOS 6 without control panel following these steps.

I got Nginx installed successfully, see this link.

But I still have a folder that isn't showing and giving me "not found errors". It's located here: /var/www/html/multicraft.

How can I fix this to let this link above be open in Nginx? Nginx gives me "404 not found" although the folder is there.

Please advise, this is my Nginx configurations:

server {
listen       80;
server_name  localhost;

#charset koi8-r;
#access_log  /var/log/nginx/log/host.access.log  main;

location / {
    root /usr/share/nginx/html;
    index   index.html index.htm;

}

#error_page  404              /404.html;

# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   /usr/share/nginx/html;
}

# proxy the PHP scripts to Apache listening on 62.141.42.165:80
#
#location ~ \.php$ {
#    proxy_pass   http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
#    root           html;
#    fastcgi_pass   127.0.0.1:9000;
#    fastcgi_index  index.php;
#    fastcgi_param  SCRIPT_FILENAME  /var/www/html/$fastcgi_script_name;
#    include        fastcgi_params;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
#    allow  all;
#}

}

slm
  • 7,355
  • 16
  • 54
  • 72

1 Answers1

0

You need to add a section to your file like this:

location /multicraft {
    root /var/www/html/multicraft;
    index   index.html index.htm;
}
slm
  • 7,355
  • 16
  • 54
  • 72
  • i add it /etc/nginx/default.conf but still not working – Rami Server May 26 '13 at 13:35
  • Are the files in that location owned by nginx's user? What errors are you getting in the log file's under this directory: `/var/log/nginx/`? – slm May 26 '13 at 13:52
  • What are you expecting it to look like? I went to this url: http://cp9.german4host.net/multicraft and got redirected here: http://cp9.german4host.net/multicraft/index.php?r=site/page&view=home – slm May 26 '13 at 13:54
  • its still not working can u send me email : admin@german4host.net, i will send u server to check problem – Rami Server May 26 '13 at 21:23
  • slm u have been redirected on httpd working but when nginx work the link isnot working gives u not found 404 or index.php file extract to u to be download – Rami Server May 26 '13 at 21:24
  • [error] 31564#0: *11 open() "/var/www/html/multicraft/multicraft/index.php" failed (2: No such file or directory), client: 37.141.22.193, server: localhost, request: "POST /multicraft//index.php?r=site/login HTTP/1.1", host: "cp9.german4host.net" – Rami Server May 26 '13 at 21:47
  • [error] 31564#0: *12 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 37.141.22.193, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "cp9.german4host.net" – Rami Server May 26 '13 at 21:48