Advertisement
Guest User

jenkins.nginx.conf

a guest
Dec 13th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.72 KB | None | 0 0
  1. server {
  2.     listen 443;
  3.     ssl                  on;
  4.  
  5.     location @404 {                                                                                                                                        
  6.       return 302 /app-path-to-404;
  7.     }    
  8.     error_page 404 = @404;
  9.  
  10.     # All your server and TLS/certificate settings are up here somewhere
  11.     ssl_certificate /etc/nginx/ssl/yourcert.pem;
  12.     ssl_certificate_key /etc/nginx/ssl/yourcert.key;
  13.  
  14.  
  15.     location ^~ /jenkins/ {
  16.         # Convert inbound server requests for https://domain.tld/jenkins/ to
  17.         # local network requests for http://yourdomain.tld:8080/jenkins/
  18.         proxy_pass http://yourdomain.tld:8080/jenkins/;
  19.  
  20.         # Rewrite HTTPS requests from WAN to HTTP requests on LAN
  21.         proxy_redirect http:// https://;
  22.  
  23.         # Proxy intercept errors
  24.         proxy_intercept_errors on;
  25.  
  26.         # The following settings from https://wiki.jenkins-ci.org/display/JENKINS/Running+Hudson+behind+Nginx
  27.         sendfile off;
  28.         proxy_set_header   Host             $host:$server_port;
  29.         proxy_set_header   X-Real-IP        $remote_addr;
  30.         proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
  31.         proxy_max_temp_file_size 0;
  32.  
  33.         #this is the maximum upload size
  34.         client_max_body_size       10m;
  35.         client_body_buffer_size    128k;
  36.  
  37.         proxy_connect_timeout      90;
  38.         proxy_send_timeout         90;
  39.         proxy_read_timeout         90;
  40.  
  41.         proxy_temp_file_write_size 64k;
  42.  
  43.         # Required for new HTTP-based CLI
  44.         proxy_http_version 1.1;
  45.         proxy_request_buffering off;
  46.         proxy_buffering off; # Required for HTTP-based CLI to work over SSL
  47.   }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement