S
S
Stanislav Pochepko2016-05-06 01:02:34
Nginx
Stanislav Pochepko, 2016-05-06 01:02:34

How to proxy JetBrains products (hub, youtrack) via nginx?

Hello.
unable to set up JetBrains products on VPS. I have my own domain.
I wrote this in nginx config.

server {
  listen 80;
  listen [::]:80;
  server_name youtrack.djzt.xyz;
  server_tokens off;
  
  location / {
    proxy_set_header X-Forwarded-Host \$http_host; 
    proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; 
    proxy_set_header X-Forwarded-Proto \$scheme; 
    proxy_http_version 1.1;
  
    proxy_pass http://localhost:2224/;
  }
}
server {
  listen 80;
  listen [::]:80;
  server_name hub.djzt.xyz;
  server_tokens off;
  
  location / {
    proxy_set_header X-Forwarded-Host \$http_host;
    proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto \$scheme;
    proxy_http_version 1.1;
  
    proxy_pass http://localhost:2222/;
  }
}
server {
  listen 80 default_server;
  listen [::]:80 default_server;
  root /var/www/html;
  index index.html index.htm index.nginx-debian.html;
  server_name djzt.xyz;
  server_tokens off;
  
  location / {
    try_files \$uri \$uri/ =404;
  }
}


And now when I follow the link hub.djzt.xyz it redirects me to the link hub.djzt.xyz/http:///hub.djzt.xyz:80/hub and accordingly nothing works.
But the hub itself works at djzt.xyz:2222

The hub itself configured to listen on port 2222 and the base-url hub.djzt.xyz
I took everything from the article on habré

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question