ubuntu nginx php7.0 fpm

ubuntu nginx php7.0 fpm

QA

ubuntu nginx php7.0 fpm

답변 2

본문

ubuntu nginx php7.0 fpm  설정으로 서버를 갈아탔는데. 일부 페이지가 깨지던가 아니면 404 not found 를 뿜어대는군요.. 그리고 몇몇 이미지도 이미지 폴더에 정상적으로 위치하고 있는데..엑박 나오고요...

혹시 어떤 이유에서 그런지 아시는분 답변좀 해주시면 감사할께요...


niginx.conf 설정입니다. 


server {
    listen       80;
    server_name xxx.com www.xxx.com;

    root   /home/ubuntu/new_www;


        charset utf-8;

        access_log  /var/log/nginx/adon.access.log  main;
        error_log  /var/log/nginx/adon.error.log;

   

        location / {
            index  index.php index.html index.htm;

        } 
        

        location /data/ {
                location ~.*\.(php|html|htm|pl|cgi|inc|lib)?$ {
                        deny all;
                }
        }

        location /data/file/ {
                location ~.* {
         #              access_log        off;
        #               log_not_found     off;
                        expires           360d;

                }
        }

        location /data/cache/ {
                allow 127.0.0.1;
                deny all;

                location ~.*\.(php|html|htm|pl|cgi|inc|lib)?$ {
                        deny all;
                }
        }


        error_page  403 404              /40x.html;
        location = /40x.html {
            root   html;
            allow all;
        }

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

        location ~*\.(jpg|jpeg|gif|png|css|js|ico|xml|swf)$ {
        access_log        off;
        log_not_found     off;
        expires           360d;

    #      valid_referers none blocked mohae.kr *.mohae.kr;
     #           if ($invalid_referer) { return 404; }


        }



       location ~ .php$ {

                fastcgi_buffer_size 128k;
                fastcgi_buffers 256 16k;
                fastcgi_busy_buffers_size 256k;
                fastcgi_temp_file_write_size 256k;
                fastcgi_read_timeout 240;

                   fastcgi_pass unix:/run/php/php7.0-fpm.sock;
       
                fastcgi_index index.php;
                try_files $uri =404;
                include fastcgi_params;
                fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
                fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;

                 fastcgi_intercept_errors on;

        }


        location ~ /\.ht {
                deny all;
       }


location = /favicon.ico {
  log_not_found off;
  access_log off;
}
location = /robots.txt {
  allow all;
  log_not_found off;
  access_log off;
}

# Deny all attempts to access any dotfile (=hidden files) such as .htaccess, .htpasswd, .DS_Store, .directory, .svn, .git, ...
location ~ /\. {
  deny all;
  access_log off;
  log_not_found off;
}

}

이 질문에 댓글 쓰기 :

답변 2

server_name 이 좀 이상해보이네요


https://blog.lael.be/post/2600


이런글 함번 참고해보세요

 

아. .질문올리시려고 변경하신거였군요


404는 파일을 못찾는거라서


홈 디렉토리 설정을 살펴보시는게 어떨까요

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 124,010
© SIRSOFT
현재 페이지 제일 처음으로