Proxy Settings In nginx For ServiceDesk

Robert Reed May 29, 2015

Does anyone have a good "recipe" for setting up nginx to proxy or redirect users to use a nicer base URL, IOW to change https://projects.commercialservices.com/servicedesk/customer/portal/3 to something better, like https://helpdesk.commercialservices.com?

I tried the setup below, and while it does work, the user gets redirected by JIRA via a 303 and the URL changes to the long form.

server {
        listen          80;
        server_name     helpdesk.*;
        access_log      off;

        client_max_body_size    10M;

        return 301 https://helpdesk.commercialservices.com$request_uri;
}

server {
        listen          443 ssl;
        server_name     helpdesk.commercialservices.com;
        access_log      off;

        client_max_body_size    10M;

        ssl_certificate         /######;
        ssl_certificate_key     /######;

        location / {
                proxy_pass              http://localhost:8080/servicedesk/customer/portal/3;
                proxy_set_header        Host            $host;
                proxy_set_header        X-Real-IP       $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
        }
}

 

 

3 answers

0 votes
Robert Reed February 4, 2016

Tom, I have not. The user-friendly, root URL seemed good enough to get people started on the portal.

0 votes
Tom Young February 3, 2016

did you ever find a better solution for this?

0 votes
Norbert Bede December 26, 2015

hi, 

your solution hide original JIRA address and stay on: helpdesk.commercialservices.com.

i can't get it work that way.

thanks. norbert

Robert Reed February 4, 2016

The above shouldn't "hide" anything. For example, on my server, I can still reach JIRA via IP and other valid addresses/URLs. The only reason I use nginx is to (try to) present users with a user-friendly URL.

Suggest an answer

Log in or Sign up to answer