[nginx] proxy_pass 이후 path가 append되지 않을때

eden·2021년 12월 1일
0

nginx

목록 보기
1/1

무중단 배포 설정중
inc파일의 변수를 include하여 포트번호를 조작하고 nginx설정 파일에서 proxy_pass를 설정하였을때,
변수 이후 path가 append되지 않는 이슈 발생.

해결방안)
proxy_pass $service_url$request_uri 형태로 해결

service_url은 inc파일에서 내가 설정한 변수 이며
request_uri는 nginx의 변수이다.

$host : opentutorials.org
$uri : /production/module/index.php
$args : type=module&id=12
server_addr : 115.68.24.88
server_name : localhost
server_port : 80
server_protocol : HTTP/1.1
$arg_type : module
$request_uri : /production/module/index.php?type=module&id=12
$request_filename : /usr/local/nginx/html/production/module/index.php

참고)
https://opentutorials.org/module/384/4508

profile
다양한 것에 관심있는 개발자입니다.

0개의 댓글