How to run "Eclipse Che" behind NGINX reverse proxy?
<p>I have installed on a server Eclipse Che and it runs perfectly on my machine when I use it locally <strong>localhost:8080</strong></p>

<p>I would like to make it available from the Internet, behind a NGINX front reverse proxy. Here is the idea:</p>

<p><strong>example.com/che/</strong>  ---> <strong>NGINX reverse proxy</strong> ---> <strong>server:8080/</strong></p>

<p>I tried so many different NGINX configuration... without success.
For information, Eclipse Che embeds a Tomcat instance with some rewrite rules:</p>

<pre><code>RewriteRule ^/api/ext/(.*)$ /ide/ext/$1 [L]
RewriteRule ^/api/(.*)$ /ide/api/$1 [L]
RewriteRule ^/$ /dashboard [R]
</code></pre>

<p>There are 3 webapps deployed on the Tomcat server:</p>

<pre><code>ide
dashboard 
swagger
</code></pre>

<p>If Eclipse Che is behind NGINX, the above rewrite rules are useless and can be done directly by NGINX (that's what I did)</p>

<p>I would like to have one single block in my NGINX configuration (if possible) Here is what I tried to do so far, but it's not fully working and Eclipse Che does not load fully (my guess is that WebSockets are not proxified, and I miss something) Basically, I tried to "proxypass" the different webapps, but this may not be the best option.</p>

<pre><code>location /dashboard {
 proxy_pass http://localhost:8080/dashboard;
 proxy_redirect off;
 proxy_set_header Host $host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /ide {
 proxy_pass http://localhost:8080/ide;
 proxy_redirect off;
 proxy_set_header Host $host;
 proxy_set_header X-Real-IP $remote_addr;
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api {
 rewrite ^/api/ext/(.*)$ /ide/ext/$1 redirect;
 rewrite ^/api/(.*)$ /ide/api/$1 redirect;
}
</code></pre>

<p>You can notice I added the rewrite rules in the NGINX "api" location rather than in the Tomcat configuration (ROOT webapp)
Thanks for your help.</p>