https 에서 www 있는 도메인을 없는 도메인으로 rewrite 또는 redirect 하기
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개
==>
return 301 http://your-domain.com$request_uri;
https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#taxing-rewrites
알려 주셔서 감사합니다.
게시판 목록
개발자팁
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5036 | 웹서버 | 4년 전 | 2147 | ||
| 5035 | 웹서버 | 4년 전 | 2177 | ||
| 5034 | 웹서버 | 4년 전 | 2405 | ||
| 5033 | 웹서버 | 4년 전 | 1781 | ||
| 5032 | 웹서버 | 4년 전 | 2139 | ||
| 5031 | 웹서버 | 4년 전 | 2518 | ||
| 5030 | MySQL | 4년 전 | 2890 | ||
| 5029 | 웹서버 | 4년 전 | 7185 | ||
| 5028 | 웹서버 |
kerimdoor
|
4년 전 | 1636 | |
| 5027 | OS | 4년 전 | 6560 | ||
| 5026 | PHP |
|
4년 전 | 4642 | |
| 5025 | JavaScript |
|
4년 전 | 2407 | |
| 5024 | MySQL |
|
5년 전 | 3822 | |
| 5023 | MySQL | 5년 전 | 3035 | ||
| 5022 | PHP | 5년 전 | 2328 | ||
| 5021 | PHP |
|
5년 전 | 3253 | |
| 5020 | PHP | 5년 전 | 4309 | ||
| 5019 | PHP | 5년 전 | 4334 | ||
| 5018 | 웹서버 | 5년 전 | 6706 | ||
| 5017 | 기타 |
HappyTank
|
5년 전 | 5072 | |
| 5016 | MySQL | 5년 전 | 3093 | ||
| 5015 | 기타 | 5년 전 | 2279 | ||
| 5014 | 기타 | 5년 전 | 2839 | ||
| 5013 | 기타 | 5년 전 | 2257 | ||
| 5012 | 기타 | 5년 전 | 2268 | ||
| 5011 | 기타 | 5년 전 | 2220 | ||
| 5010 | 기타 | 5년 전 | 1779 | ||
| 5009 | 기타 | 5년 전 | 2388 | ||
| 5008 | 기타 | 5년 전 | 2020 | ||
| 5007 | 기타 | 5년 전 | 1983 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기