Advertisement
kyoryo

ssl reverse proxy

Aug 24th, 2020 (edited)
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.31 KB | None | 0 0
  1. # set ssl on nginx reverse proxy
  2. # https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-with-ssl-as-a-reverse-proxy-for-jenkins
  3.  
  4. upstream dockerapp {
  5.    server 127.0.0.1:8080;
  6.    keepalive 64;
  7. }
  8.  
  9. server {
  10.     listen      80;
  11.     listen      443 ssl;
  12.     server_name subdomain.domain.com;
  13.     error_log   /var/log/nginx/error.log info;
  14.  
  15.     ssl_certificate     /etc/nginx/cert.crt;
  16.     ssl_certificate_key /etc/nginx/cert.key;
  17.  
  18.     ssl on;
  19.     ssl_session_cache  builtin:1000  shared:SSL:10m;
  20.     ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
  21.     ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
  22.     ssl_prefer_server_ciphers on;
  23.  
  24.     location / {
  25.       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  26.       proxy_set_header X-Real-IP $remote_addr;
  27.       proxy_set_header Host $host;
  28.       #proxy_set_header X-Forwarded-Proto $scheme;
  29.       #proxy_set_header X-Forwarded-Host  $host;
  30.       #proxy_set_header X-Forwarded-Port  $server_port;
  31.  
  32.       proxy_http_version 1.1;
  33.       proxy_set_header Upgrade $http_upgrade;
  34. #      proxy_set_header Connection "upgrade";
  35.       proxy_set_header Connection $http_connection;
  36.  
  37.       proxy_pass http://dockerapp/;
  38. #      proxy_pass http://localhost:8080;
  39.       proxy_redirect off;
  40.       proxy_read_timeout 240s;
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement