macsplex.com 로그인

검색

nginx
2021.12.30 00:51

nginx rewrite 예제

조회 수 462 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 게시글 수정 내역 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 게시글 수정 내역 댓글로 가기 인쇄
Extra Form
출처/참고/홈페이지 https://playneko.github.io/2020/05/28/ra...ry-pi-012/

웹서버 nginx 사용한다면 웹사이트 특정부문이 폐쇠되어 다른사이트로 이동이 필요할때 nginx server설정에 해당설정을 추가해줍니다.

데비안기준 /etc/nginx/sites-available/default 파일에 Server { 아래부문에 넣으면 됩니다.

http://dnavi.info/info으로 접속되는 모든것을 https://macsplex.com/information 으로 넘기고 싶을때 아래의 코드를 입력하였습니다.

 

 

location /info/ {
 rewrite ^/info(/.*)$ https://macsplex.com/information
 brake;
}

 

적용이 완료되어 해당아래의 링크를 누르면 https://macsplex.com/information 으로 접속이 됩니다.

 

http://dnavi.info/info/entry/%EC%9C%88%EB%8F%84%EC%9A%B0-%EC%84%A4%EC%B9%98%EC%A4%91-%ED%8C%8C%EB%9E%80%ED%99%94%EB%A9%B4%EB%B8%94%EB%A3%A8%EC%8A%A4%ED%81%AC%EB%A6%B0%EC%97%90-0x0000008E-%EC%97%90%EB%9F%AC

 

일반적으로 페이지를 rewrite를 하고 싶을때는 php를 사용하여 할수 있습니다.

아래의 코드를 특정페이지에 넣어주면 https://macsplex.com/information 으로 바로 이동하게 됩니다.

 

<?php
header("Location:https://macsplex.com/information");
?>

 

 

 

 





--------------------------------------------------광고(Advertising)-------------------------------------------------------------------------------------


TAG •

리눅스 Tip

Linux Tip

  1. VMware Remote-Console 설치 에러

    CategoryFedora
    Read More
  2. sudo 유저추가

    CategoryFedora
    Read More
  3. yarn 설치방법

    CategoryFedora
    Read More
  4. 우분투 18.04 영문판에서 한글입력 추가

    CategoryUbuntu
    Read More
  5. CentOS 8 웹콘솔(Cokpit) 설치하기

    CategoryCentOS
    Read More
  6. nginx "rewrite" directive is not allowed here in 에러발생시

    CategoryDebian
    Read More
  7. 워드프레스 고유주소 nginx 설정

    CategoryDebian
    Read More
  8. 웹로그분석툴 GoAccess

    CategoryDebian
    Read More
  9. Ngnix 특정폴더 인증절차추가

    CategoryDebian
    Read More
  10. nginx semrush bot 차단

    Categorynginx
    Read More
  11. nginx rewrite 예제

    Categorynginx
    Read More
Board Pagination Prev 1 ... 3 4 5 6 7 8 Next
/ 8