Monitoring Splunk

Redirect port 80 to port 443?

msarro
Builder

Hi everyone. I just installed a custom cert this afternoon on our development search head, and after some stumbling we were able to get it to work. We ended up having to set the httpport field to 443, and then the configurations given in these docs worked fine:
http://docs.splunk.com/Documentation/Splunk/5.0.3/Admin/Webconf
http://docs.splunk.com/Documentation/Splunk/5.0.3/Security/TroubleshootyourSplunkWebauthentication
http://docs.splunk.com/Documentation/Splunk/5.0.3/Security/TurnonbasicencryptionwithSplunkWeb

Now, the only issue is if a user types in our URL, it will show a 404 error. They have to know to manually type in http*S*://my.example.com to go to splunk.

In a perfect world there would be a httpport option for web.conf, and also a httpsport option for web.conf. If you went to the http, it would perform the redirect elegantly.

Is there any easy way to automatically redirect the http request on port 80 to the https request on port 443? Any help would be appreciated. Thanks!

Tags (1)
0 Karma

jtrucks
Splunk Employee
Splunk Employee

Since you are talking about changing protocols from HTTP to HTTPS, you need to do this with something that can send the browser a redirect. Consider putting apache or some other HTTP server on port 80 answering with HTTP and issuing an HTTP redirect code. Another method is a reverse proxy to connect to the other port. Lastly, just have an HTTP server answer and display the default index page with a with a delay of 0 seconds so the redirect used is immediate.

--
Jesse Trucks
Minister of Magic

adrianathome
Communicator

Have you tried to redirect via iptables?
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 443

0 Karma

jzhang723
Engager

I downvoted this post because not working at all

0 Karma

cam343
Path Finder

This won't work due to HTTP GET requests encountering HTTPS session establishment requests

0 Karma
Get Updates on the Splunk Community!

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...

Splunk App Dev Community Updates – What’s New and What’s Next

Welcome to your go-to roundup of everything happening in the Splunk App Dev Community! Whether you're building ...

The Latest Cisco Integrations With Splunk Platform!

Join us for an exciting tech talk where we’ll explore the latest integrations in Cisco + Splunk! We’ve ...