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. phpbb에서 로그인 에러가 나올시에..

    Read More
  2. php5연동 curl 설치

    Read More
  3. php 업로드 용량 제한 변경하기

    Read More
  4. OpenXenManager 설치방법

    CategoryUbuntu
    Read More
  5. OpenCubicPlayer

    CategoryUbuntu
    Read More
  6. Ngnix 특정폴더 인증절차추가

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

    CategoryDebian
    Read More
  8. Nginx 이미지링크 방지

    CategoryDebian
    Read More
  9. nginx semrush bot 차단

    Categorynginx
    Read More
  10. nginx rewrite 예제

    Categorynginx
    Read More
  11. Nginx php-fpm 설정

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

    CategoryDebian
    Read More
  13. nautilus-image-converter

    CategoryUbuntu
    Read More
  14. mysql의 최대 성능 향상 방법

    CategoryDB
    Read More
  15. MySQL에서 백업 및 복구

    CategoryDB
    Read More
  16. MySQL에서 root 암호 설정

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

    CategoryDB
    Read More
  18. Mysql 자동 백업 하기

    CategoryDB
    Read More
  19. Mysql table 깨졌을때

    CategoryDB
    Read More
  20. mysql root password 변경

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