-1

I have several applications running on the same cluster and want to set up a subdomain for each application. To give you a brief description of current set up, I have a Django app, Jira, and Gitlab running in a cluster. It would be nice I can redirect all requests to

Django App via xxxx.com(even localhost)/django-app

Jira: xxx.com(+ localhost)/jira

Also, I need to make sure any links within Django app should pick up this subdomain from the frontend so when if there is an tag, it should always send users to xxx.com(localhost)/django-app/category/page

I have been looking at Nginx reverse proxy but I cannot get subdomains to work like I want above. Please help!

Jason Marsh
  • 107
  • 1
  • 3
    Do you want to set up the applications on those URLs and redirect from the old URLs, or do you want to reverse proxy so existing applications stay the same but the URL changes? We can help you solve problems, but we're not a consulting service. Show us the config you have and tell us why it didn't work. If you need someone to do it for you hiring a consultant is the best bet. – Tim Jan 01 '18 at 23:18
  • Thanks but I'm not interested in hiring consultants =(./. – Jason Marsh Jan 02 '18 at 03:20
  • 3
    In that case you need to clarify your problem and show us your efforts to date. We can help you solve problems, but we don't solve problems for you based on vague requirements. – Tim Jan 02 '18 at 03:36

1 Answers1

0

Use like this in the example, please let me know if you have issues

server {
  server_name abc.com;

  location /django-app {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8080/;
#Assuming that your backend python Django application server(uwsgi/)is #running behind the tcp port 8080
  }
  location /jira {
     proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8081/;
#Assuming that your Atlasian Jira is running behind the tcp port 8081
  }
}