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. No Image in Fedora

    VMware Remote-Console 설치 에러

  2. No Image in Fedora

    sudo 유저추가

  3. No Image in Fedora

    yarn 설치방법

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

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

  6. No Image in Debian

    nginx "rewrite" directive is not allowed here in 에러발생시

  7. No Image in Debian

    워드프레스 고유주소 nginx 설정

  8. 웹로그분석툴 GoAccess

  9. No Image in Debian

    Ngnix 특정폴더 인증절차추가

  10. No Image in nginx

    nginx semrush bot 차단

  11. No Image in nginx

    nginx rewrite 예제

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