• 흐림동두천 1.0℃
  • 흐림강릉 1.3℃
  • 서울 3.2℃
  • 대전 3.3℃
  • 대구 6.8℃
  • 울산 6.6℃
  • 광주 8.3℃
  • 부산 7.7℃
  • 흐림고창 6.7℃
  • 흐림제주 10.7℃
  • 흐림강화 2.2℃
  • 흐림보은 3.2℃
  • 흐림금산 4.4℃
  • 흐림강진군 8.7℃
  • 흐림경주시 6.7℃
  • 흐림거제 8.0℃
기상청 제공

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