Skip to content

Instantly share code, notes, and snippets.

@patrickmslatteryvt
Last active December 22, 2015 07:48
Show Gist options
  • Save patrickmslatteryvt/6440267 to your computer and use it in GitHub Desktop.
Save patrickmslatteryvt/6440267 to your computer and use it in GitHub Desktop.
nginx conf for JIRA
Config # 1
server {
listen 80;
server_name xxx.devdmz.xxx.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 300;
location / {
proxy_pass http://localhost:8080;
proxy_redirect http://localhost:8080/jira $scheme://$host/;
}
location /stash {
proxy_pass http://localhost:7990;
proxy_redirect http://localhost:7990/ $scheme://$host/stash/;
proxy_redirect http://localhost:7990/stash $scheme://$host/stash;
}
}
======================================
Config # 2
server {
listen 443;
server_name xxx.devdmz.xxx.com;
ssl on;
ssl_certificate /opt/local/etc/ssl/certs/nginx.crt;
ssl_certificate_key /opt/local/etc/ssl/private_keys/nginx.key;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 300;
location / {
proxy_pass http://localhost:8080;
proxy_redirect http://localhost:8080 $scheme://$host/;
}
location /stash {
proxy_pass http://localhost:7990;
proxy_redirect http://localhost:7990 $scheme://$host;
proxy_redirect http://localhost:7990 $scheme://$host;
}
}
======================================
$ curl -ikv https://10.254.250.71 #
* About to connect() to 10.254.250.71 port 443 (#0)
* Trying 10.254.250.71...
* 0x8001f150 is at send pipe head!
* STATE: CONNECT => WAITCONNECT handle 0x800573f0; line 1032 (connection #0)
* Connected to 10.254.250.71 (10.254.250.71) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: /usr/ssl/certs/ca-bundle.crt
CApath: none
* SSLv3, TLS handshake, Client hello (1):
* STATE: WAITCONNECT => PROTOCONNECT handle 0x800573f0; line 1145 (connection #0)
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using ECDHE-RSA-AES256-SHA
* Server certificate:
* subject: O=MyWebGrocer; OU=Engineering; CN=nginx
* start date: 2013-09-03 22:55:29 GMT
* expire date: 2013-10-03 22:55:29 GMT
* issuer: O=MyWebGrocer; OU=Engineering
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* STATE: PROTOCONNECT => DO handle 0x800573f0; line 1164 (connection #0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 10.254.250.71
> Accept: */*
>
* STATE: DO => DO_DONE handle 0x800573f0; line 1236 (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x800573f0; line 1352 (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x800573f0; line 1363 (connection #0)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Server: nginx
Server: nginx
< Date: Wed, 04 Sep 2013 17:49:44 GMT
Date: Wed, 04 Sep 2013 17:49:44 GMT
< Content-Type: text/html
Content-Type: text/html
< Content-Length: 46
Content-Length: 46
< Connection: keep-alive
Connection: keep-alive
< Vary: Accept-Encoding
Vary: Accept-Encoding
< Last-Modified: Sun, 25 Aug 2013 22:55:10 GMT
Last-Modified: Sun, 25 Aug 2013 22:55:10 GMT
< ETag: "2e-4e4cd881fadf0"
ETag: "2e-4e4cd881fadf0"
< Accept-Ranges: bytes
Accept-Ranges: bytes
<
<html><body><h1>I am JIRA!</h1></body></html>
* STATE: PERFORM => DONE handle 0x800573f0; line 1533 (connection #0)
* Connection #0 to host 10.254.250.71 left intact
======================================
$ curl -ikv https://10.254.250.71/stash #
* About to connect() to 10.254.250.71 port 443 (#0)
* Trying 10.254.250.71...
* 0x8001f150 is at send pipe head!
* STATE: CONNECT => WAITCONNECT handle 0x800573f0; line 1032 (connection #0)
* Connected to 10.254.250.71 (10.254.250.71) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: /usr/ssl/certs/ca-bundle.crt
CApath: none
* SSLv3, TLS handshake, Client hello (1):
* STATE: WAITCONNECT => PROTOCONNECT handle 0x800573f0; line 1145 (connection #0)
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using ECDHE-RSA-AES256-SHA
* Server certificate:
* subject: O=MyWebGrocer; OU=Engineering; CN=nginx
* start date: 2013-09-03 22:55:29 GMT
* expire date: 2013-10-03 22:55:29 GMT
* issuer: O=MyWebGrocer; OU=Engineering
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* STATE: PROTOCONNECT => DO handle 0x800573f0; line 1164 (connection #0)
> GET /stash HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 10.254.250.71
> Accept: */*
>
* STATE: DO => DO_DONE handle 0x800573f0; line 1236 (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x800573f0; line 1352 (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x800573f0; line 1363 (connection #0)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 404 Not Found
HTTP/1.1 404 Not Found
< Server: nginx
Server: nginx
< Date: Wed, 04 Sep 2013 17:49:49 GMT
Date: Wed, 04 Sep 2013 17:49:49 GMT
< Content-Type: text/html; charset=iso-8859-1
Content-Type: text/html; charset=iso-8859-1
< Content-Length: 203
Content-Length: 203
< Connection: keep-alive
Connection: keep-alive
< Vary: Accept-Encoding
Vary: Accept-Encoding
<
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /stash was not found on this server.</p>
</body></html>
* STATE: PERFORM => DONE handle 0x800573f0; line 1533 (connection #0)
* Connection #0 to host 10.254.250.71 left intact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment