DRVTiny

site.conf

Jul 8th, 2020
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 3.10 KB | None | 0 0
  1. server {
  2.         server_name                     *.bsbp.corp.com bsbp.corp.com;
  3.         server_name_in_redirect         off;
  4.  
  5.         listen 10.179.68.84:443 ssl     default_server;
  6.  
  7.         access_log /var/log/nginx/vhosts/bsbp.corp.com/access.log;
  8.         error_log /var/log/nginx/vhosts/bsbp.corp.com/error.log debug;
  9.  
  10.         ssl_certificate                 /etc/ssl/certs/bsbp.corp.com.crt;
  11.         ssl_certificate_key             /etc/ssl/certs/bsbp.corp.com.crt;
  12.  
  13.         root /var/www/html;
  14.  
  15.         location /pub {
  16.                 index index.html;
  17.         }
  18.  
  19.         location ~ /logout.cgi$ {
  20.                 add_header Set-Cookie "jwt_auth_data=;domain=bsbp.corp.com";
  21.                 return 302 https://ecoclient.online.corp.com/mainpage;
  22.         }
  23.         location ~ /(?!pub) {
  24.                 recursive_error_pages on;
  25.  
  26.                 error_page 402 = /setcookie;
  27.                 error_page 401 = /back2eco;
  28.                 error_page 406 = /pub;
  29.  
  30.                 if ( $arg_gpbtoken != '' ) {
  31.                 auth_request /cookiecheck;
  32.                 auth_request_set        $my_remote_user  $sent_http_remote_user;
  33.                 auth_request_set        $my_client_id    $sent_http_client_id;
  34.                 auth_request_set        $my_valid_until  $sent_http_jwt_valid_until;
  35.                
  36.                 proxy_pass                      https://goz.corp.com;
  37.  
  38.                 proxy_ssl_certificate           /etc/ssl/ca/crt/10.189.68.84.crt;
  39.                 proxy_ssl_certificate_key       /etc/ssl/ca/private/10.189.68.84.key;
  40.                 proxy_ssl_trusted_certificate   /etc/ssl/ca/rootCA.crt;
  41.                 proxy_ssl_verify                on;
  42.                 proxy_ssl_verify_depth          1;
  43.  
  44.                 proxy_set_header        X-Remote-User   $my_remote_user;
  45.                 proxy_set_header        X-Client-ID     $my_client_id;
  46.                 proxy_set_header        X-Valid-Until   $my_valid_until;
  47.                 proxy_set_header Host $host;
  48.         }
  49.        
  50.         location /setcookie {
  51.                 internal;
  52.                 proxy_pass http://localhost:5000/setcookie;
  53.                 proxy_set_header X-Orig-Dest  "$scheme://$http_host";
  54.                 proxy_set_header X-Request-URI $request_uri;
  55.  
  56.         }      
  57.        
  58.         location /cookiecheck {
  59.                 internal;
  60.                 proxy_pass http://localhost:5000/cookiecheck;
  61.                 proxy_pass_request_body off;
  62.                 proxy_set_header        Content-Length "";
  63.                 proxy_set_header X-Orig-Dest  "$scheme://$http_host";
  64.                 proxy_set_header X-Request-URI $request_uri;
  65.         }
  66.  
  67.         location /back2eco {
  68.                 add_header Set-Cookie "BSSREDIR=$scheme://$http_host$request_uri;Domain=ecoclient.online.corp.com;Path=/";
  69.                 return 302 https://ecoclient.online.corp.com;
  70.  
  71.         }
  72.  
  73.         location /login {
  74.                 proxy_pass http://localhost:5000/login;
  75.                 proxy_set_header X-Orig-Dest  "$scheme://$http_host";
  76.                 proxy_set_header X-Request-URI $request_uri;
  77.         }
  78. }
Add Comment
Please, Sign In to add comment