2017-12-20 33 views
0

나는 평범한 상황에 처해있다. 새 서버에서 아파치를 nginx로 옮겼습니다. nginx + php-fpm + mariadb가 설정되었습니다.Nginx + Yii app = js, css-net :: ERR_CONNECTION_REFUSED

이제 MVC 구조의 오류 외에 어디에도 튀어 나온 또 다른 버그가 있습니다. Chrome 콘솔에 jpg 및 css 파일 연결시 red-net :: ERR_CONNECTION_REFUSED가 채워져 있습니다.

무엇이 될 수 있습니까? 자산 Yii Component에 오류가 있습니까 아니면 NGINX 구성입니까? 여기 내 구성입니다.

server { 
    listen 80; 
    server_name example.ru; 
    root /var/www/sites/example.ru; 

    set $yii_bootstrap "index.php"; 

    charset utf-8; 

    location/{ 
     index index.html $yii_bootstrap; 
     auth_basic "Restricted Content"; 
     auth_basic_user_file /etc/nginx/.htpasswd; 
     try_files $uri $uri/ /$yii_bootstrap?$args; 
    } 

    location ~ ^/(protected|framework|themes/\w+/views) { 
     deny all; 
    } 

    location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { 
     try_files $uri =404; 
    } 

    error_page 404 /404.html; 
    error_page 500 502 503 504 /50x.html; 
    location = /50x.html { 
     root /usr/share/nginx/html; 
    } 

    location ~ \.php$ { 
     fastcgi_pass php-fpm; 
       fastcgi_split_path_info ^(.+\.php)(.*)$; 
       set $fsn /$yii_bootstrap; 
       if (-f $document_root$fastcgi_script_name){ 
        set $fsn $fastcgi_script_name; 
       } 

       include fastcgi_params; 
       fastcgi_param SCRIPT_FILENAME $document_root$fsn; 


       fastcgi_param PATH_INFO  $fastcgi_path_info; 
       fastcgi_param PATH_TRANSLATED $document_root$fsn; 
    } 

    location ~ \.css { 
     add_header Content-Type text/css; 
    } 

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

}

htaccess로 내가 새로 이동 한 후 내 Nginx의 서버에서 SSL을 사용하는 것을 잊었다

AddDefaultCharset UTF-8 

php_flag display_startup_errors on 
php_flag display_errors on 
php_flag html_errors on 
+0

ERR_CONNECTION_REFUSED를 얻은 전체 URL을 다시 확인하고 서버와 포트가 올바른지 다시 확인하십시오. 나에게 의미가있는 유일한 것은 당신이 어딘가에 잘못하고 있다는 것입니다. –

답변

0

거의 비어와 모든 스크립트 서버는 HTTPS '로 시작되었다의 검색어 : // '.