Use a .htaccess file as a url redirect proxy to ip

Markus March 29, 2019

Hi guys,


I run Jira-Software on a dedicated server in a docker container. I dont want my users to use the IP address of this server to access jira. Instead I want them to use a subdomain lets call it jira.abc.com But for that I have to forward the subdomain to the server IP. For that I us an .htaccess file with the proxy flag, which works perfectly.
So a user types in the browser https://www.jira.abc.com and the .htaccess proxy forwards the user to the IP, while in the browser the url is still displayed. Everything fine so far.

--- .htaccess ---

RewriteEngine On
RewriteRule (.*)$ http://SERVER_IP:9990/$1 [P]

---

For some reason jira is very slow, but besides of that everything seems to work fine.
One problem I have is that jira logs this exception, which so far I now means something like it cannot reach itself over the url.

HealthCheck:thread-3 ERROR      [c.a.t.j.healthcheck.support.GadgetFeedUrlHealthCheck] An error occurred when performing the Gadget feed URL healthcheck
java.net.SocketTimeoutException: Read timed out


In the /opt/atlassian/jira/server.xml I edited the Connector and added the following:
- proxyName="www.jira.abc.com"
- proxyPort="443"
- scheme="https"

The questions I have are the following:
- Can I use a .htaccess file as proxy?
- Could the exception above be the reason why jira is so slow?

2 answers

1 accepted

1 vote
Answer accepted
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 29, 2019
0 votes
Amit Verma May 21, 2021

I have written a short tutorial for people who want to learn the basics of Apache URL rewriting. You can read the tutorial to improve your URL rewriting skills.

https://amitoverflow.com/2021/04/15/htaccess-tutorial-for-beginers/ 

Suggest an answer

Log in or Sign up to answer