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에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 5246 | node.js |
swallow
|
2년 전 | 1105 | |
| 5245 | PHP |
swallow
|
2년 전 | 2528 | |
| 5244 | PHP |
swallow
|
2년 전 | 1287 | |
| 5243 | JavaScript |
swallow
|
2년 전 | 685 | |
| 5242 | node.js |
swallow
|
2년 전 | 667 | |
| 5241 | node.js |
swallow
|
2년 전 | 779 | |
| 5240 | MySQL |
swallow
|
2년 전 | 808 | |
| 5239 | MySQL | 2년 전 | 784 | ||
| 5238 | JavaScript | 2년 전 | 983 | ||
| 5237 | 웹서버 |
swallow
|
2년 전 | 3990 | |
| 5236 | PHP |
swallow
|
2년 전 | 900 | |
| 5235 | PHP |
swallow
|
2년 전 | 1379 | |
| 5234 | 기타 | 2년 전 | 762 | ||
| 5233 | jQuery |
swallow
|
2년 전 | 2036 | |
| 5232 | 2년 전 | 618 | |||
| 5231 | 2년 전 | 1174 | |||
| 5230 | 2년 전 | 1076 | |||
| 5229 | PHP |
swallow
|
2년 전 | 1024 | |
| 5228 | MySQL | 2년 전 | 726 | ||
| 5227 | PHP |
swallow
|
2년 전 | 837 | |
| 5226 | PHP |
swallow
|
2년 전 | 1811 | |
| 5225 | PHP | 2년 전 | 576 | ||
| 5224 | node.js |
swallow
|
2년 전 | 4084 | |
| 5223 | PHP |
swallow
|
2년 전 | 1317 | |
| 5222 | 기타 |
techstar
|
2년 전 | 563 | |
| 5221 | PHP | 2년 전 | 653 | ||
| 5220 |
swallow
|
2년 전 | 906 | ||
| 5219 | 2년 전 | 881 | |||
| 5218 | 2년 전 | 523 | |||
| 5217 | 2년 전 | 1001 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기