Dashboards & Visualizations

How to configure IIS to proxy Splunk Javascript JDK requests from outside Splunk Web?

pedromvieira
Communicator

How can I configure IIS to work as a Proxy for connecting to Splunk Web from outside?

http://dev.splunk.com/view/SP-CAAAEW6

PS: I´m trying login_form and login_verify examples.

http://dev.splunk.com/view/SP-CAAAEWS

My IIS: 127.0.0.1:8080
My Splunk: 127.0.0.1:8089 (In a Virtual Machine with port redirect)

My Chrome console when I submit in login_form.

 POST http://127.0.0.1:8080/proxy/services/auth/login?output_mode=json 404 (Not Found)
login_form.html:84 Login failed:  Object {response: Object, status: 404, data: "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric…↵ </fieldset> ↵</div> ↵</div> ↵</body> ↵</html> ↵", error: "Not Found"}

My web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <outboundRules>
                <rule name="SplunkOut" preCondition="" stopProcessing="true">
                    <match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="(.*)://(.*):(.*)/proxy/(.*)" />
                    <action type="Rewrite" value="{R:1}://{R:2}:8080/proxy/{R:4}" />
                </rule>
                <preConditions>
                    <preCondition name="ResponseIsHTML">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                    </preCondition>
                    <preCondition name="ResponseIsJSON">
                        <add input="{RESPONSE_CONTENT_TYPE}" pattern="^application/json" />
                    </preCondition>
                </preConditions>
            </outboundRules>
            <rules>
                <rule name="SplunkIn" stopProcessing="true">
                    <match url="(.*)://(.*):(.*)/proxy/(.*)" />
                    <conditions>
                        <add input="{QUERY_STRING}" pattern="^(https?)://" />
                    </conditions>
                    <serverVariables>
                        <set name="HTTP_ACCEPT_ENCODING" value="" />
                    </serverVariables>
                    <action type="Rewrite" url="{R:1}://{R:2}:8089/proxy/{R:4}" logRewrittenUrl="true" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
0 Karma

AshChakor
Path Finder

I have the same issue, did you find out the answer for how to configure IIS to work as a Proxy for connecting to Splunk Web from outside? Can you please share the settings on IIS server

0 Karma

sloshburch
Splunk Employee
Splunk Employee

@AshChakor - what about the answer provided below? Did that work?

0 Karma

sloshburch
Splunk Employee
Splunk Employee
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...