테스트 사이트 - 개발 중인 베타 버전입니다

https 에서 www 있는 도메인을 없는 도메인으로 rewrite 또는 redirect 하기

· 4년 전 · 2390 · 4

Nginx 설정 입니다.

 

 

...

 

    server {
       listen         80;
       server_name    your-domain.com www.your-domain.com;

       rewrite ^/(.*) https://your-domain.com/$1 permanent;
    }

 

    server {
        listen        443 ssl;
        server_name   www.your-domain.com;

        ssl_certificate          conf.d/your-domain.com.crt.pem;
        ssl_certificate_key      conf.d/your-domain.com.key.pem;
        ssl_trusted_certificate  conf.d/your-domain.com.ca-chain-bundle.pem;

        rewrite ^/(.*) https://your-domain.com/$1 permanent;
    }

 

    server {
        listen        443 ssl;
        server_name   your-domain.com;
        root          /home/your-domain/www;

        ssl_certificate          conf.d/your-domain.com.crt.pem;
        ssl_certificate_key      conf.d/your-domain.com.key.pem;
        ssl_trusted_certificate  conf.d/your-domain.com.ca-chain-bundle.pem;

 

...

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 4개

4년 전
좋은 정보 감사합니다.
rewrite ^/(.*) https://your-domain.com/$1 permanent;
==>
return 301 http://your-domain.com$request_uri;

https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#taxing-rewrites
살펴 보도록 하겠습니다.
알려 주셔서 감사합니다.
필요했었는데.. 정보 감사합니다.

게시글 목록

번호 제목
16429
16424
16423
16412
16408
16407
16401
16395
16394
16391
16390
16389
16387
16386
JavaScript js playground
16382
16381
16377
16374
16372
16356
16355
16354
16353
16347
16346
16339
16338
16332
16331
16330