Cybersecurity
DevOps Cloud (ADM)
IT Operations Cloud
mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.original
mkdir -p /etc/nginx/conf.d/includes
touch /etc/nginx/conf.d/idm.acme.com.conf /etc/nginx/conf.d/includes/ssl_security_options.conf
*1 upstream sent too big header while reading response header from upstream, client
*1 connect() to 172.16.21.132:8543 failed (13: Permission denied) while connecting to upstream, client: 172.16.23.64, server: idm.uniscomp.cz, request: "GET /idmdash HTTP/2.0", upstream: "https://172.16.21.132:8543/idmdash", host: "idm.acme.com"
Note: make sure that tomcat and OSP use the same SSL certificates as nginx, this might save you some headaches. I took my base64 certificates and imported them into osp.jks and also created keystore with same certificates and pointed tomcat to it.
<Connector port="8543" protocol="org.apache.coyote.http11.Http11NioProtocol" maxThreads="150" SSLEnabled="true" scheme="https" secure="true" clientAuth="false" sslProtocol="TLSv1.2" keystoreFile="conf/_.acme.com.ks" keystorePass="changeit" sslEnabledProtocols="TLSv1.2" />
For keystore manipulation, you can use keytool, or my favourite GUI Portecle.
Note: I am using headless CentOS server, so no GUI is available. If I wanted to run configupdate.sh GUI, I had to connect with 'ssh -X idm2' and use X forwarding. Also had to install xorg-x11-xauth libXext libXrender libXtst packages, in order for it to work.
Error
{"Fault":{"Code":{"Value":"Sender","Subcode":{"Value":"XDAS_OUT_POLICY_VIOLATION"}},"Reason":{"Text":"Unrecognized interface. Invalid Host Header Name or Request URL Domain Name."}}}
Preamble: [OSP]
Priority Level: FINER
Java: internal.osp.common.logging.HttpRequestLogger.log() [340] thread=https-jsse-nio-8543-exec-9
Time: 2018-07-11T13:46:19.709 0200
Log Data: HttpServletRequest (Number 1)
Method: GET
Request URL: /osp/a/idm/auth/oauth2/grant
Query String: ?redirect_uri=https://idm.acme.com/idmdash/oauth.html&client_id=idmdash&response_type=token
Scheme: https
Context Path: /osp
Servlet Path: /a
Path Info: /idm/auth/oauth2/grant
Server Name: idm.acme.com
Server Port: 8543
Locale: en_US
Host IP Address: 172.16.21.132
Remote Client IP Address: 172.16.21.132
Headers
host=idm.acme.com:8543
x-real-ip=172.16.23.64
x-forwarded-for=172.16.23.64
x-forwarded-proto=https
connection=close
upgrade-insecure-requests=1
user-agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3472.3 Safari/537.36
accept=text/html,application/xhtml xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
referer=https://idm.acme.com/idmdash/
accept-encoding=gzip, deflate, br
accept-language=en-US,en;q=0.9
One interesting article: https://devtidbits.com/2015/12/08/nginx-as-a-reverse-proxy-to-apache-tomcat/