<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Why does my configuration not work for Splunk 5 proxy behind nginx, but does work behind apache? in Security</title>
    <link>https://community.splunk.com/t5/Security/Why-does-my-configuration-not-work-for-Splunk-5-proxy-behind/m-p/136552#M4206</link>
    <description>&lt;P&gt;I'm trying to implement this for oauth:&lt;BR /&gt;
&lt;A href="https://github.com/bitly/google_auth_proxy" target="_blank"&gt;https://github.com/bitly/google_auth_proxy&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Before using that, I tried simple proxying with nginx.&lt;BR /&gt;
Here is my &lt;STRONG&gt;nginx&lt;/STRONG&gt; config which &lt;STRONG&gt;does not work&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;server {
    listen 443 default ssl;
    server_name splunk.mydomain.com;
    ssl on;
    ssl_certificate /etc/nginx/ssl/wild.mydomain.com.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;
    add_header Strict-Transport-Security max-age=1209600;

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_connect_timeout 1;
        proxy_send_timeout 30;
        proxy_read_timeout 30;
       proxy_pass  http://10.13.5.29:8000/;
    }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That doesn't work and seem to direct back to &lt;A href="http://splunk.mydomain.com" target="_blank"&gt;http://splunk.mydomain.com&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This is my &lt;STRONG&gt;apache&lt;/STRONG&gt; config which &lt;STRONG&gt;works&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;VirtualHost *:80&amp;gt;
    ServerName splunk.mydomain.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    ProxyPreserveHost On
    ProxyPass /cgi-bin !
    ProxyPass / http://10.13.5.29:8000/ retry=0
    ProxyPassReverse / http://10.13.5.29:8000/ retry=0

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

&amp;lt;/VirtualHost&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is my &lt;STRONG&gt;web.conf&lt;/STRONG&gt; file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[settings]
enableSplunkWebSSL = 0
tools.sessions.timeout = 4320
enable_autocomplete_login = True
tools.proxy.on = True
SSOMode = permissive
tools.proxy.base = http://10.13.5.29:8000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using splunk 5&lt;/P&gt;

&lt;P&gt;Anything I'm doing wrong?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 19:28:54 GMT</pubDate>
    <dc:creator>splunk0</dc:creator>
    <dc:date>2020-09-28T19:28:54Z</dc:date>
    <item>
      <title>Why does my configuration not work for Splunk 5 proxy behind nginx, but does work behind apache?</title>
      <link>https://community.splunk.com/t5/Security/Why-does-my-configuration-not-work-for-Splunk-5-proxy-behind/m-p/136552#M4206</link>
      <description>&lt;P&gt;I'm trying to implement this for oauth:&lt;BR /&gt;
&lt;A href="https://github.com/bitly/google_auth_proxy" target="_blank"&gt;https://github.com/bitly/google_auth_proxy&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Before using that, I tried simple proxying with nginx.&lt;BR /&gt;
Here is my &lt;STRONG&gt;nginx&lt;/STRONG&gt; config which &lt;STRONG&gt;does not work&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;server {
    listen 443 default ssl;
    server_name splunk.mydomain.com;
    ssl on;
    ssl_certificate /etc/nginx/ssl/wild.mydomain.com.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;
    add_header Strict-Transport-Security max-age=1209600;

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_connect_timeout 1;
        proxy_send_timeout 30;
        proxy_read_timeout 30;
       proxy_pass  http://10.13.5.29:8000/;
    }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That doesn't work and seem to direct back to &lt;A href="http://splunk.mydomain.com" target="_blank"&gt;http://splunk.mydomain.com&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This is my &lt;STRONG&gt;apache&lt;/STRONG&gt; config which &lt;STRONG&gt;works&lt;/STRONG&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;VirtualHost *:80&amp;gt;
    ServerName splunk.mydomain.com

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html

    ProxyPreserveHost On
    ProxyPass /cgi-bin !
    ProxyPass / http://10.13.5.29:8000/ retry=0
    ProxyPassReverse / http://10.13.5.29:8000/ retry=0

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

&amp;lt;/VirtualHost&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is my &lt;STRONG&gt;web.conf&lt;/STRONG&gt; file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[settings]
enableSplunkWebSSL = 0
tools.sessions.timeout = 4320
enable_autocomplete_login = True
tools.proxy.on = True
SSOMode = permissive
tools.proxy.base = http://10.13.5.29:8000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using splunk 5&lt;/P&gt;

&lt;P&gt;Anything I'm doing wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:28:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Why-does-my-configuration-not-work-for-Splunk-5-proxy-behind/m-p/136552#M4206</guid>
      <dc:creator>splunk0</dc:creator>
      <dc:date>2020-09-28T19:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why does my configuration not work for Splunk 5 proxy behind nginx, but does work behind apache?</title>
      <link>https://community.splunk.com/t5/Security/Why-does-my-configuration-not-work-for-Splunk-5-proxy-behind/m-p/136553#M4207</link>
      <description>&lt;P&gt;I spent a few hours on this and got this working. I wanted to share as I'm both a fan of NGINX and Splunk. I am using NGINX v1.6.2 and Splunk (on Windows) v6.2.2&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Your Site .conf file referenced in nginx.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;server {
        listen &amp;lt;IP-Address-of-NGINX-For-Splunk&amp;gt;:80;
        server_name &amp;lt;URL-You-Set-In-DNS-For-Splunk&amp;gt;;
        location / {
        # Redirect to HTTPS
        return 301 &lt;A href="https://$server_name$request_uri" target="test_blank"&gt;https://$server_name$request_uri&lt;/A&gt;;
        }
}

server {
        listen &amp;lt;IP-Address-of-NGINX-For-Splunk&amp;gt;:443 ssl;
        server_name &amp;lt;URL-You-Set-In-DNS-For-Splunk&amp;gt;;
     #Resolve HTTP Error 414 Request-URI-Too-Large
        large_client_header_buffers 6 16k;
     #Certificate &amp;amp; Key .PEM Format
        ssl_certificate /etc/ssl/&amp;lt;name-of-cert&amp;gt;.crt;
        ssl_certificate_key /etc/ssl/&amp;lt;name-of-key&amp;gt;.key;
     #PFS
        ssl_dhparam /etc/ssl/&amp;lt;name-of-DH-key&amp;gt;.dh;
     #HSTS
        add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
     #OSCP
        ssl_stapling on;
        ssl_stapling_verify on;
        ssl_trusted_certificate /etc/ssl/alk-splunk02.oscp;
     #CIPHERS
        include sites.common;
        location / {
            proxy_pass_request_headers on;
            proxy_set_header x-real-IP $remote_addr;
            proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
            proxy_set_header host $host;
            proxy_pass &lt;A href="https://&amp;lt;IP-Address-of-Your-Splunk-Server&amp;gt;:8000" target="test_blank"&gt;https://&amp;lt;IP-Address-of-Your-Splunk-Server&amp;gt;:8000&lt;/A&gt;;
        }
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;A+ Rating on SSL Labs provided you have a SHA256 Cert from trusted CA and intermediates provided inside .crt file&lt;/STRONG&gt;&lt;BR /&gt;
This is sites.common:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;     #OSCP Stapling
        resolver &amp;lt;DNS-Server-IP-1-You-Want&amp;gt; &amp;lt;DNS-Server-IP-2-You-Want&amp;gt; valid=300s;
        resolver_timeout 5s;

     #Cipher Specification and Session Cache
        ssl_prefer_server_ciphers on;
        ssl_session_cache shared:SSL:10m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers 'ECDH+AESGCM:DH+AESGCM:AES256+EECDH:AES256+EDH:!aNULL';
        proxy_ssl_session_reuse off;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Apr 2015 16:09:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Why-does-my-configuration-not-work-for-Splunk-5-proxy-behind/m-p/136553#M4207</guid>
      <dc:creator>alkamiadmin</dc:creator>
      <dc:date>2015-04-22T16:09:14Z</dc:date>
    </item>
  </channel>
</rss>

