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.

Using app_direct and redirect to https

See original GitHub issue

Hello,

I’m using app_direct functionnality and want to redirect http to https, everything works fine except when I use :

https://www.mycompany.com

it redirect me to :

http://www.mycompany.com/app_direct/myapp

Without https.

My Nginx config is:

server {
  listen                80;
  server_name           mycompany.com www.mycompany.com;
  rewrite     ^(.*)     https://$server_name$1 permanent;
  # return 301 https://$server_name$request_uri;
}


server {
  listen                443 ssl;
  server_name           mycompany.com www.mycompany.com;
  access_log            /var/log/nginx/shinyproxy.access.log;
  error_log             /var/log/nginx/shinyproxy.error.log error;

  ssl on;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;

  ssl_certificate       /etc/ssl/certs/mycompany.cert;
  ssl_certificate_key   /etc/ssl/private/mycompany.key;

   location / {
       proxy_pass          http://127.0.0.1:3838/;

       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       proxy_read_timeout 600s;

       proxy_redirect    off;
       proxy_set_header  Host             $http_host;
       proxy_set_header  X-Real-IP        $remote_addr;
       proxy_set_header  X-Forwarded-For  $proxy_add_x_forwarded_for;
       proxy_set_header  X-Forwarded-Protocol $scheme;
     }

}

Is there something bad in my config ?

Thanks for your help.

Victor

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
egdecommented, Nov 18, 2020

I found that fix on another thread as well, when I noticed that this Spring config does not exist, And yes -

server:
  forward-headers-strategy: "native"

is the fix here!

1reaction
egdecommented, Nov 18, 2020

Exactly! That error I have as well

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSO flow for web server applications - Product Help - AppDirect
The user is redirected to the previously registered Initiate Login URL to initiate SSO at the Developer. · The Developer initiates SSO by...
Read more >
How can I redirect HTTP requests to HTTPS using ... - YouTube
How can I redirect HTTP requests to HTTPS using an Application Load Balancer?
Read more >
Redirect to apps/root based on path · Issue #332 - GitHub
In my server, https://compbio.imm.medicina.ulisboa.pt/voyager redirects to https://compbio.imm.medicina.ulisboa.pt/app/voyAGEr. It allows to ...
Read more >
When user is not logged in Jira is not redirecting to login page ...
How can we force users to redirect to login page in such cases? ... Install the app https://marketplace.atlassian.com/apps/1220406/upraise- ...
Read more >
GoToAssist Remote Support (v16.9.1 Web) Release Notes
All FastSupport URLs redirect to https://fastsupport.gotoassist.com ... This means that when agents (who host support sessions using the ...
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