nginx ssl이 적용된 서버에서 네이버 페이 xml을 위해 특정 url만 http로 변환시키는 방법 채택완료
현재 다음과 같은 방법을 통해 nginx를 설정 ssl을 운영하고 있습니다.
server {
listen 80;
server_name .example.com;
return 301 https://$server_name$request_uri;">https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name .example.com;
root /home/example.com/www;
client_max_body_size 10M;
keepalive_timeout 70;
헌데 네이버페이를 적용하는데 있어 다음과 같은 메일을 받았습니다.
현재 가맹점 url이 http://%7E/" target="_blank" style="background-color: transparent;">http://~ 로 접근할 경우 무조건 https://%7E/" target="_blank" style="background-color: transparent;">https://~ 로 리디렉션 되게 처리되어 있는 것으로 확인되는데
상품정보 xml url은 https://xn--%7E-ky7m/" target="_blank" style="background-color: transparent;">https://~로 리디렉션 되지 않게 http url로 예외처리를 부탁드리며
http://www.hellomilja.com/shop/naverpay/naverpay_item.php?ITEM_ID=ba00000006" target="_blank" style="background-color: transparent;">http://www.example.com/shop/naverpay/naverpay_item.php?ITEM_ID=ba00000006
해당 상품정보 xml의 Content-Type이 application/xml이 맞는지 확인 부탁드립니다.
이를 해결하기 위해 인터넷 상의 여러 방법으로 redirection을 시도해 보았으나
적용이 안되거나 페이지를 찾을 수 없다는 형식으로만 나와 헤매고 있습니다.
제가 적용한 코드는 다음과 같습니다.
location ~ /shop/naverpay {
#rewrite ^ http://$host$request_uri">http://$host$request_uri paramenant;
return 301 http://$host$request_uri;">http://$host$request_uri;
}
location, if 문을 사용하여 여러 곳에서 코드를 변형, 적용해 보았으나
해결책을 탖지 못하고 있습니다.
혹 조언을 주실 수 있으시다면 부탁 드리겠습니다
답변 1개
5번째줄 11번째줄 참고하세요.
출처: http://nanati.me/htaccess-http-https-ssl/">http://nanati.me/htaccess-http-https-ssl/
.htaccess 기입방법
- RewriteEngine On
- RewriteBase /
- # HTTP로 접속 된 경우,
- RewriteCond %{HTTPS} off
- # 아래의 URL은 항상 https로 리다이렉트
- RewriteCond %{HTTP_HOST} http://www.example.com">www.example.com
- RewriteCond %{REQUEST_URI} ^/admin/.*$ [OR]
- RewriteCond %{REQUEST_URI} ^/inquiry/.*$
- # 단 아래를 제외하고.
- RewriteCond %{REQUEST_URI} !^/assets/.*$
- RewriteCond %{REQUEST_URI} !^.*\.(js|css|gif|jpg|png|ico|php)$
- # https로 리다이렉트
- RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
- # HTTPS로 접속 된 경우,
- RewriteCond %{HTTPS} on
- # 아래의 URL이외는 항상 http로 리다이렉트
- RewriteCond %{HTTP_HOST} http://www.example.com">www.example.com
- RewriteCond %{REQUEST_URI} !^/admin/.*$
- RewriteCond %{REQUEST_URI} !^/inquiry/.*$
- # 단 아래를 제외하고.
- RewriteCond %{REQUEST_URI} !^/assets/.*$
- RewriteCond %{REQUEST_URI} !^.*\.(js|css|gif|jpg|png|ico|php)$
- # http로 리다이렉트
- RewriteRule ^.*$ http://%{HTTP_HOST}%{REQUEST_URI} [R,L]
답변에 대한 댓글 2개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
좋은 하루 되세요!!! 너무 감사 합니다 ^^