• 구름많음동두천 21.2℃
  • 구름조금강릉 19.6℃
  • 구름많음서울 22.2℃
  • 맑음대전 22.0℃
  • 맑음대구 18.1℃
  • 맑음울산 18.3℃
  • 맑음광주 20.4℃
  • 구름조금부산 20.4℃
  • 구름많음고창 20.8℃
  • 구름조금제주 19.7℃
  • 구름많음강화 20.3℃
  • 맑음보은 18.3℃
  • 맑음금산 19.1℃
  • 맑음강진군 20.1℃
  • 맑음경주시 18.7℃
  • 구름많음거제 18.3℃
기상청 제공

nginx 환경변수 출력

nginx 환경변수 출력하기 위한 설정들
To check nginx environment variables
How can I check the nginx environment variable?

nginx 환경변수 출력하기 위한 설정들
To check nginx environment variables
How  can I check the nginx environment variable?

 

아래 설정으로 request_uri, protocol 을 확인할 수 있다.

 

server {

  listen 80

  ..

  ..

 

 

  location ~ .(php|html|htm|php3)$ {

    proxy_pass  http://apache;

    ..

    proxy_set_header X-Original-Request $request_uri;

    proxy_set_header X-Forwarded-Proto $scheme;

  }

 

}

 

 

변수명

request_uri : HTTP_X_ORIGINAL_REQUEST

protocol : HTTP_X_FORWARDED_PROTO

 

참조사이트

https://www.opentutorials.org/module/384/4508

https://serverfault.com/questions/515957/how-to-have-nginx-forward-the-http-x-forwarded-proto-header

https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-load-balancing-with-ssl-termination

https://stackoverflow.com/questions/28472692/serverrequest-uri-with-nginx-proxy-server-get-rewritten-page-urls