Nginx 80port를 443port로 redirect 하기
2025. 1. 30. 12:57ㆍWeb Server/nginx
http://test.co.kr로 오는 요청을 https://test.co.kr로 redirect함
server {
listen 80;
listen [::]:80;
server_name test.co.kr, temp.co.kr;
location / {
return 301 https://$host$request_uri;
}
}
만약 temp.co.kr이 여기에 포함되어 있지 않으면, http://temp.co.kr로 호출시, http://test.co.kr이 작함
'Web Server > nginx' 카테고리의 다른 글
Nginx 특정 IP 막기 (0) | 2025.02.01 |
---|---|
Nginx 414 Request-URI Too Large 에러 조치 (0) | 2025.01.30 |
Nginx 파일 업로드 용량 제한 조치 (0) | 2024.12.30 |
Nginx proxy에서 client IP를 backend에 전달하기 (0) | 2024.12.29 |
nginx tcp proxy 설정 (0) | 2024.05.04 |