question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Access behind reverse proxy

See original GitHub issue

Hi !

I open another issue because I try to access to the web UI behind a reverse proxy. To run joal, the command is : java -jar /opt/joal/jack-of-all-trades-2.1.3.jar --joal-conf=/opt/joal --spring.main.web-environment=true --server.port=7073 --joal.ui.path.prefix=joal --joal.ui.secret-token="test"

Now, if I visit _http://x.x.x.x:7073/joal/ui/_ though local network, it works with those parameters :

Now, if I set up a virtual host behind a reverse proxy :

<VirtualHost *:443>
	DocumentRoot "/var/www/html"
	ServerName joal.server.fr
	ServerAlias www.joal.server.fr

	LogLevel warn
	ErrorLog ${APACHE_LOG_DIR}/joal-error.log
	CustomLog ${APACHE_LOG_DIR}/joal-access.log combined

	RewriteEngine On
	RewriteCond %{HTTP_HOST} !^www\. [NC]
	RewriteRule ^(.*)$ http://www.%{HTTP_HOST}$1 [R=301,L]

	<Directory /var/www/joal/>
		Options +FollowSymLinks -Indexes -MultiViews
		AllowOverride all
		Order allow,deny
		allow from all
	</Directory>

	ProxyPass / http://127.0.0.1:7073/joal/ui/
	ProxyPassReverse / http://127.0.0.1:7073/joal/ui/
	ProxyRequests Off

        Include /etc/letsencrypt/options-ssl-apache.conf
        SSLCertificateFile /etc/letsencrypt/live/joal.server.fr/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/joal.server.fr/privkey.pem
</VirtualHost>
</IfModule>

The web UI works but I’ve got this message in the right top corner :

The parameters are :

I don’t know if it’s possible to use it behind a reverse proxy with SSL encryption like but.

Thanks for your help 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:32 (24 by maintainers)

github_iconTop GitHub Comments

1reaction
JourneyOvercommented, Apr 23, 2021

Yep putting

proxy_connect_timeout 30m;
proxy_send_timeout 30m;
proxy_read_timeout 30m;

into the location block for ws.joal.domain.tld seems to have worked.

Thanks a bunch for the help, still can’t believe it was just a simple thing of needing to change the proxy_pass for ws.joal.domain.tld to not include the /MyPathPrefix/ui/ bit to make things work as needed >.<

Can’t wait for the rewrite of joal to be done, so I can get my hands on it!

1reaction
anthonyraymondcommented, Apr 23, 2021

Glad it works 😃

One question I do need to ask now though is, why does the websocket seem to randomly close every now and then and then open again a second or two later? There are no error message or anything in the error.log file for nginx, and I don’t remember if this happened on http or not and it doesn’t seem to happen at all when I go to the WEBUI through means of just IP address and not through my domain.

That an issue with proxy that joal v1 had. It’s already solved in the version i’m rewriting from scratch. What happen is: if the webui does not exchange message (receive or send) message with the server for 30s the reverse proxy will consider the connection dead and close it forcefully. Thanksfully the webui has a recover mechanism that connect back as soon as it’s closed but i agree that’s a pain in the back.

There is a way though to prevent ngnx to auto close every 30s or 1m, you can use some config and i think those are the one:

proxy_connect_timeout 30m;
proxy_send_timeout 30m;
proxy_read_timeout 30m;
Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a reverse proxy? | Proxy servers explained - Cloudflare
A reverse proxy protects web servers from attacks and can provide performance and reliability benefits. Learn more about forward and reverse proxies.
Read more >
How To Set Up a Reverse Proxy (Step-By-Step for Nginx ...
A reverse proxy is a great way to set this up as it can receive the incoming traffic before it reaches the origin...
Read more >
What is a Reverse Proxy Server? - NGINX
A proxy server is a go‑between or intermediary server that forwards requests for content from multiple clients to different servers across the Internet....
Read more >
Running Behind a Reverse Proxy - Sonatype Help
We provide some general guidance on how to configure common reverse proxy servers ... This means every URL path used to access the...
Read more >
Configuring AM Behind a Reverse Proxy - ForgeRock Backstage
Reverse proxies (such as ForgeRock Identity Gateway) are proxy servers that sit between clients and application servers. Their main function is to act...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found