2013-11-21 3 views
0

NGINX가 magento를 제공하지 않는다고 생각합니다 CSS & 정확한 위치에서 JS 파일을 찾을 수 있습니다 */data/www/public_html/hotnstylish/public/* 그러나 nginx는 생각하는 것 같습니다. 그것의/etc/nginx/html! ?? 프론트 엔드와 백엔드 모두 어떤 스타일도없이 모든 단서를로드하는 것이 좋을 것입니다! 내 Nginx의 오류 로그의NGINX MAGENTO v1.7 CSS + JS 작동하지 않음

부 :

server { 
listen  80; 
server_name 836237.vps-10.com; 
root /data/www/public_html/hotnstylish/public/; 

access_log /data/www/public_html/hotnstylish/log/access.log; 
error_log /data/www/public_html/hotnstylish/log/error.log; 

location/{ 
    root /data/www/public_html/hotnstylish/public/; 
    index index.html index.htm index.php; 
    try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler 
    expires 30d; ## Assume all files are cachable 
    include /etc/nginx/mime.types; 
} 

# error_page 404    /404.html; 

# redirect server error pages to the static page /50x.html 
# 
# proxy the PHP scripts to Apache listening on 127.0.0.1:80 
# 
# location ~ \.php$ { 
# proxy_pass http://127.0.0.1; 
#} 

## These locations would be hidden by .htaccess normally 
location ^~ /app/    { deny all; } 
location ^~ /includes/   { deny all; } 
location ^~ /lib/    { deny all; } 
location ^~ /media/downloadable/ { deny all; } 
location ^~ /pkginfo/   { deny all; } 
location ^~ /report/config.xml { deny all; } 
location ^~ /var/    { deny all; } 


location ~ \.css { 
    add_header Content-Type text/css; 
} 
location ~ \.js { 
    add_header Content-Type application/x-javascript; 
} 

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 
# 
    location ~ ^/(app|includes|lib|media/downloadable|pkginfo|report/config.xml|var)/ { internal; } 
    location /var/export/ { internal; } 
    location /. { return 404; } 
    location @handler { rewrite//index.php; } 
    location ~* .php/ { rewrite ^(.*.php)/ $1 last; } 
    location ~* .php$ { 
if (!-e $request_filename) { rewrite//index.php last; } 
expires off; 
root   /data/www/public_html/hotnstylish/public/; 
fastcgi_pass 127.0.0.1:9000; 
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
fastcgi_param MAGE_RUN_CODE default; 
fastcgi_param MAGE_RUN_TYPE store; 
include fastcgi_params; 


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

내 Ngingx.conf을 : (지저분한 지옥으로) 다음과 같이

2013/11/20 23:26:08 [error] 13982#0: *3 open() "/etc/nginx/html/js/calendar/calendar.js" failed (2: No such file or directory), client: 89.168.219.134, server: 836237.vps-10.com, request: "GET /js/calendar/calendar.js HTTP/1.1", host: "836237.vps-10.com", referrer: "http://836237.vps-10.com/index.php/admin/dashboard/index/key/d6a8576bd8743279b6812c60ccd6b464/" 

2013/11/20 23:26:08 [error] 13982#0: *5 open() "/etc/nginx/html/js/calendar/calendar-setup.js" failed (2: No such file or directory), client: 89.168.219.134, server: 836237.vps-10.com, request: "GET /js/calendar/calendar-setup.js HTTP/1.1", host: "836237.vps-10.com", referrer: "http://836237.vps-10.com/index.php/admin/dashboard/index/key/d6a8576bd8743279b6812c60ccd6b464/" 

내 가상 호스트 설정 파일이

user nginx; 
worker_processes 4; 

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


events { 
worker_connections 1024; 
} 

http { 
#include  /etc/nginx/mime.types; 
default_type application/octet-stream; 

log_format main '$remote_addr - $remote_user [$time_local] "$request "' 
        '$status $body_bytes_sent "$http_referer" ' 
        '"$http_user_agent" "$http_x_forwarded_for"'; 
access_log /var/log/nginx/access.log main; 

sendfile  on; 
autoindex off; 
map $scheme $fastcgi_https { ## Detect when HTTPS is used 
    default off; 
    https on; 
} 

keepalive_timeout 10; 

gzip on; 
gzip_comp_level 2; 
gzip_proxied any; 
gzip_types  text/plain text/html text/css application/x-javascript text/xml  application/xml application/xml+rss text/javascript; 

# Load config files from the /etc/nginx/conf.d directory 
#include /etc/nginx/conf.d/*.conf; 

#Load vHosts file for each site separately 
include /etc/nginx/sites-enabled/*; 

} 

답변

0

올바른 server_name 컨텍스트에서 요청이 처리되었는지 확인하십시오.

당신의 nginx를 사용하는 경우 ≥0.8.21

listen  80 default_server; 
server_name 836237.vps-10.com; 
+0

가를 시도하지만 여전히 같은 설정하려고합니다. 감사합니다. – linux007