macsplex.com 로그인

검색

nginx
2021.12.30 00:51

nginx rewrite 예제

조회 수 465 추천 수 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 php-fpm 설정

    CategoryDebian
    Read More
  2. nginx rewrite 예제

    Categorynginx
    Read More
  3. nginx semrush bot 차단

    Categorynginx
    Read More
  4. Nginx 이미지링크 방지

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

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

    CategoryDebian
    Read More
  7. OpenCubicPlayer

    CategoryUbuntu
    Read More
  8. OpenXenManager 설치방법

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

    Read More
  10. php5연동 curl 설치

    Read More
  11. phpbb에서 로그인 에러가 나올시에..

    Read More
  12. phpmyadmin 업로드 용량늘이기

    CategoryDB
    Read More
  13. qshutdown

    CategoryUbuntu
    Read More
  14. scp 명령어를 이용한 파일 복사 및 전송

    Read More
  15. Setting Up the OpenLDAP Server

    Read More
  16. sudo 유저추가

    CategoryFedora
    Read More
  17. tar 명령어로 압축하기, 압축풀기

    Read More
  18. TAR을 이용한 권한설정까지 압축하기

    Read More
  19. Transmageddon

    CategoryUbuntu
    Read More
  20. ubuntu kvm install

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