Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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;
#}

}

share|improve this question

1 Answer 1

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

location /multicraft {
    root /var/www/html/multicraft;
    index   index.html index.htm;
}
share|improve this answer
    
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: cp9.german4host.net/multicraft and got redirected here: cp9.german4host.net/multicraft/index.php?r=site/… –  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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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