ubuntu nginx php7.0 fpm

8년 전 조회 3,198

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

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


niginx.conf 설정입니다. 

Copy
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개

@미드나잇쿨 

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


404는 파일을 못찾는거라서


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

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

홈 디렉토리 설정을 어느부분을 봐야할까요? drwxr-xr-x 29 ubuntu ubuntu 4096 Aug 24 18:53 new_www
현재 설정은 이렇게 되어있습니다.

댓글을 작성하려면 로그인이 필요합니다.

server_name 이 좀 이상해보이네요


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


이런글 함번 참고해보세요

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

sever_name 주소는 이상이없는듯합니다.. 정상적으로 접속됩니다.

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고