2016-08-01 6 views
1

postname을 사용하기 위해 퍼머 링크 구조를 변경했습니다. 캐시를 삭제하기 위해 Nginx를 다시 시작했지만, 내 홈페이지를 표시 할 수있는 경우에도 오거 링크를 클릭해도 얻을 수 있습니다. 404 페이지는 여기 wordpress - 404 페이지가 permalinks를 업데이트 한 후 찾을 수 없습니다. Nginx

가 사용 위치 섹션입니다 ... Nginx에 사용

, 나는 htaccess로 파일을 업데이트 할 필요가 없습니다,하지만 난 내 사이트의 Nginx의 conf 파일을 업데이트해야합니다 ... 찾을 수 없음 .php

 location ~ \.php$ { 
      try_files $uri =404; 
      fastcgi_pass 127.0.0.1:9000; 
      # fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 
      fastcgi_index index.php; 
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
      include fastcgi_params; } 

주셔서 감사합니다. feedbac K

답변

3

그것은 전체 파일 부분이 아니다 ... 지금은 잘 작동

location/{ 
     # include the "?$args" part so non-default permalinks doesn't break when using query string 
     try_files $uri $uri/ /index.php?$args; 
    } 

에/위치를 업데이트! 서버 {}이 (가) 없습니다.

사용이 하나 있지만 서버 사이의 하나를 사용 {}와 작동합니다

location ~ \.php$ { 
     try_files $uri =404; 
     fastcgi_pass 127.0.0.1:9000; 
     # fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 
     fastcgi_index index.php; 
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
     include fastcgi_params; 
} 
if (!-e $request_filename) { 
    rewrite ^.*$ /index.php last; 
}