macsplex.com 로그인

검색

nginx
2021.12.30 00:51

nginx rewrite 예제

조회 수 460 추천 수 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. nginx rewrite 예제

    Categorynginx
    Read More
  2. nginx semrush bot 차단

    Categorynginx
    Read More
  3. Ngnix 특정폴더 인증절차추가

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

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

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

    CategoryDebian
    Read More
  7. CentOS 8 웹콘솔(Cokpit) 설치하기

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

    CategoryUbuntu
    Read More
  9. yarn 설치방법

    CategoryFedora
    Read More
  10. sudo 유저추가

    CategoryFedora
    Read More
  11. VMware Remote-Console 설치 에러

    CategoryFedora
    Read More
  12. 리눅스 민트 19.1 테사(Tessa) 업그레이드 방법

    CategoryLinuxmint
    Read More
  13. Arch 저장소(repo)추가 방법

    CategoryArch
    Read More
  14. Gzip 압축효율 확인사이트

    Read More
  15. Nginx 이미지링크 방지

    CategoryDebian
    Read More
  16. Nginx사용시 업로드용량변경

    CategoryDebian
    Read More
  17. Mysql(MaridaDB)접속시 ERROR 2002 발생시

    CategoryDB
    Read More
  18. apache2 ssl 모드 활성 및 비활성화 명령어

    CategoryApache2
    Read More
  19. 페도라 방화벽포트열기

    CategoryFedora
    Read More
  20. 페도라에서 VLC를 설치하고 싶을때

    CategoryFedora
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 Next
/ 8