Advertisement
csckhw303

default.config

Jun 20th, 2019
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 3.90 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name localhost;
  4. root /usr/share/nginx/html;
  5.  
  6. # referece healthcheck file in nginx container /usr/share/nginx/html folder
  7. location = /healthcheck {
  8. }
  9.  
  10.   location /auth {
  11.   proxy_pass http://localhost:9090/auth$is_args$args;
  12.   proxy_redirect off;
  13. }
  14.  
  15. location /loginToIdp {
  16.   proxy_pass http://localhost:9090/login;
  17. }
  18.  
  19. location /SFDCChangePassword  {
  20.     return 302 https://dev-miscg.cs20.force.com/miptest/MIP_ForgotPassword;
  21. }
  22.  
  23.  
  24. location ~* /loggedIn {
  25.     rewrite (.*)/loggedIn  https://dev.iv.example.com/$1 permanent;
  26. }
  27.  
  28. location = /validate {
  29.   internal;
  30.   # forward the /validate request to Vouch Proxy
  31.   proxy_pass http://localhost:9090;
  32.  
  33.   # be sure to pass the original host header
  34.   proxy_set_header Host dev.iv.example.com;
  35.  
  36.   # Vouch Proxy only acts on the request headers
  37.   proxy_pass_request_body off;
  38.   proxy_set_header Content-Length "";
  39.  
  40.   # optionally add X-Vouch-User as returned by Vouch Proxy along with the request
  41.   auth_request_set $auth_resp_x_vouch_user $upstream_http_x_vouch_user;
  42.  
  43.   # these return values are used by the @error401 call
  44.   auth_request_set $auth_resp_jwt $upstream_http_x_vouch_jwt;
  45.   auth_request_set $auth_resp_err $upstream_http_x_vouch_err;
  46.   auth_request_set $auth_resp_failcount $upstream_http_x_vouch_failcount;
  47.  
  48. }
  49.  
  50. # if validate returns `401 not authorized` then forward the request to the error401block
  51. error_page 401 = @error401;
  52.  
  53. location @error401 {
  54.     # redirect to Vouch Proxy for login
  55.      return 302  http://dev.iv.example.com/loginToIdp?url=https://dev.iv.example.com$request_uri/loggedIn&vouch-failcount=$auth_resp_failcount&X-Vouch-Token=$auth_resp_jwt&error=$auth_resp_err;
  56.  
  57.       }
  58.  
  59. location ~/api/spg/administration/(.*) {
  60.     # return 301 http://apidns:8084/administration/$1;
  61.     proxy_http_version 1.1;
  62.     auth_request /validate;
  63.     proxy_pass http://apidns:8084/administration/$1?$query_string;
  64.     proxy_redirect off;
  65.     proxy_set_header Host $host;
  66.     proxy_set_header X-Real-IP $remote_addr;
  67.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  68. }
  69.  
  70. location ~/api/research/document/(.*) {
  71.     proxy_http_version 1.1;
  72.     auth_request /validate;
  73.     proxy_pass http://apidns:8081/api/mdc/pdf?docId=$1&alt=pdf;
  74.     proxy_redirect off;
  75.     proxy_set_header Host $host;
  76.     proxy_set_header X-Real-IP $remote_addr;
  77.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  78. }
  79.  
  80. location ~/api/search/(.*) {
  81.     proxy_http_version 1.1;
  82.     auth_request /validate;
  83.     proxy_pass http://apidns:8081/api/mdc/research?$query_string;
  84.     proxy_redirect off;
  85.     proxy_set_header Host $host;
  86.     proxy_set_header X-Real-IP $remote_addr;
  87.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  88. }
  89.  
  90. location ~/api/profile/(.*) {
  91.     proxy_http_version 1.1;
  92.     auth_request /validate;
  93.     proxy_pass http://apidns:8081/api/sfdc/employee?$query_string;
  94.     proxy_redirect off;
  95.     proxy_set_header Host $host;
  96.     proxy_set_header X-Real-IP $remote_addr;
  97.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  98. }
  99.  
  100. location ~/api/team/(.*) {
  101.     proxy_http_version 1.1;
  102.     auth_request /validate;
  103.     proxy_pass http://apidns:8081/api/sfdc/team?$query_string;
  104.     proxy_redirect off;
  105.     proxy_set_header Host $host;
  106.     proxy_set_header X-Real-IP $remote_addr;
  107.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  108. }
  109.  
  110.  
  111. location / {
  112.     auth_request /validate;
  113.  
  114.     proxy_pass http://internal-iport-qa3-dotcms-elb-1111111.us-east-1.elb.amazonaws.com/;
  115.     proxy_set_header X-Vouch-User $auth_resp_x_vouch_user;
  116.     proxy_set_header Host $host;
  117.     proxy_set_header X-Real-IP $remote_addr;
  118.     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  119. }
  120.  
  121. # redirect server error pages to the static page /50x.html
  122. error_page   500 502 503 504  /error;
  123. location = /50x.html {
  124.     root   /usr/share/nginx/html;
  125. }
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement